I've tracked it to what I think is issues with my javascript and the DOCTYPE statement (XHTML). In my reading I've found no good reason why it shouldn't work but I thought i'd ask on here to see if anybody knows what exactly is wrong with my javascript thats making it "uncompliant".
Here is the code:
Code: Select all
<script language="Javascript" type="text/javascript">
<!--
var now = new Date();
var event = new Date("June 5 12:00:0");
var seconds = (event - now) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
ID=window.setTimeout("update();", 1000);
function update()
{
now = new Date();
seconds = (event - now) / 1000;
seconds = Math.floor(seconds);
minutes = seconds / 60;
minutes = Math.floor(minutes);
hours = minutes / 60;
hours = Math.floor(hours);
days = hours / 24;
days = Math.floor(days);
document.getElementById(\'days\').innerHTML = days;
document.getElementById(\'hours\').innerHTML = hours;
document.getElementById(\'minutes\').innerHTML = minutes;
document.getElementById(\'seconds\').innerHTML = seconds;
document.getElementById(\'full\').innerHTML = days + (days==1?" day ":" days ") + (hours-24*day\
s) + (\
hours-24*days==1?" hour ":" hours ") + (minutes - 60*hours) + (minutes-60*hours==1?" minute and ":" minutes and ")\
+ (\
seconds - minutes*60) + (seconds-minutes*60==1?" second":" seconds");
ID=window.setTimeout("update();",1000);
}
// -->
</script>
<div id=full></div>
<table>
<tr>
<td align=right>Days:</td>
<td id=days align=right></td>
</tr>
<tr>
<td align=right>Hours:</td>
<td id=hours align=right></td>
</tr>
<tr>
<td align=right>Minutes:</td>
<td id=minutes align=right></td>
</tr>
<tr>
<td align=right>Seconds:</td>
<td id=seconds align=right></td>
</tr>
</table>
M.G.
EDIT: Forget the slashes before the apostrophes and on line breaks, i copied it out of a putty/emacs session from the original place in some PHP code of mine.