Click to See Complete Forum and Search --> : HELP!! Javascript Timezone clock


his boy elroy
03-14-2003, 06:25 AM
Hello everyone:

I am working on a page (http://edesedoret.com/company.html) (the page with a portion of the new script has been uploaded to my server) for my new site which contains a map, that illustrates the position of the sun based on GMT. I received the following script which would enable images (stored in maps bin numbered 00.gif to 23.gif) to change every hour based on the GMT:

<script language=javascript>
function update()
{
var curDate = new Date();
time = curDate.getUTCHours();
hour = ss = (time<10)?"0"+time:time;
document.getElementById('pic').src=hour+".gif";
setTimeout("update()",1000);
}

</script>
</head>

<body onload="update()">
<img src="01.gif" id="pic">
</body>

</html>

I am not sure where to place the following line without causing the page to distort:
<body onload="update()">

his boy elroy
03-14-2003, 06:35 AM
Thanks for replying, when I place (<body onload="update()">) within the body it distorts the page.

his boy elroy
03-14-2003, 07:04 AM
Please excuse the dumb question but I am no Java script guru; Where do you suggest that I place the alternate script, in the head field or body?