mat106
12-11-2004, 02:11 AM
Hello.
Can anyone see why this simple script will not loop as it's supposed to?
<html>
<head>
<script>
function depart() {
today = new Date();
leave = new Date(2004, 12, 18, 13, 30, 00, 0);
difference = leave.getTime() - today.getTime();
document.write ("<h1>" + difference + "</h1>");
setTimeout ("depart()", 1000);
}
</script>
</head>
<body onload="depart();">
</body>
</html>
The debugger in firefox says "depart is not defined"
Can anyone see why this simple script will not loop as it's supposed to?
<html>
<head>
<script>
function depart() {
today = new Date();
leave = new Date(2004, 12, 18, 13, 30, 00, 0);
difference = leave.getTime() - today.getTime();
document.write ("<h1>" + difference + "</h1>");
setTimeout ("depart()", 1000);
}
</script>
</head>
<body onload="depart();">
</body>
</html>
The debugger in firefox says "depart is not defined"