Spudhead
01-03-2007, 03:31 PM
<script type="text/javascript">
function updateCountdown(){
var today = new Date(); //today's date
var today2 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours(), today.getMinutes(), today.getSeconds());
var launch = new Date(2007, 0, 8, 0, 0, 0); //Launch date
var diff = launch-today2; //difference in milliseconds
var seconds = new String(diff/1000); //calculate seconds and convert to string
document.getElementById("countDown").innerHTML = "<p>That's only " + seconds + " seconds away.</p>";
setTimeout("updateCountdown()",1000);
}
</script>
Ok, it's not pretty but... well, it works in Firefox, it works in Opera, there's no warnings or anything. In IE7 (Win) I get an error message on the line:
var today = new Date(); //today's date
that tells me simply "unknown runtime error". And no countdown appears.
Am I being a muppet again? :o
function updateCountdown(){
var today = new Date(); //today's date
var today2 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours(), today.getMinutes(), today.getSeconds());
var launch = new Date(2007, 0, 8, 0, 0, 0); //Launch date
var diff = launch-today2; //difference in milliseconds
var seconds = new String(diff/1000); //calculate seconds and convert to string
document.getElementById("countDown").innerHTML = "<p>That's only " + seconds + " seconds away.</p>";
setTimeout("updateCountdown()",1000);
}
</script>
Ok, it's not pretty but... well, it works in Firefox, it works in Opera, there's no warnings or anything. In IE7 (Win) I get an error message on the line:
var today = new Date(); //today's date
that tells me simply "unknown runtime error". And no countdown appears.
Am I being a muppet again? :o