Thread: JavaScript
View Single Post
  #1 (permalink)  
Old April 4th, 2011, 07:54 AM
crashbandicoot crashbandicoot is offline
Authorized User
Points: 128, Level: 2
Points: 128, Level: 2 Points: 128, Level: 2 Points: 128, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2011
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default JavaScript

Does anyone know whats wrong with this code? The screen is blank, even though I enable and allow scripts and Active X conrols to be on. I've even tried putting the javascipt code in the body element instead of the head, but still nothing happens? any clues?

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Getting the date</title>



<script type="text/JavaScript">

date = new Date();
time = date.getHours();

if (time < 12) {
document.write("Good Morning");
}
if (time < 18 && time => 12) {
document.write("Good Afternoon");
}
if (time => 18 && time < 24) {
document.write("Good Evening");
}
</script>
</head>

</html>

Thanks
Reply With Quote
The Following User Says Thank You to crashbandicoot For This Useful Post:
unicode (April 27th, 2011)