Clock in Mozilla

  • khayoz
  • Beginner
  • Beginner
  • khayoz
  • Posts: 44
  • Loc: Australia

Post 3+ Months Ago

I have made a clock, 24 hour, with seconds, it ticks like normal, doesnt need to refresh for it to work, only problem is i go to view it in mozilla and nothing shows up, i have given a copy of my code. Is it a mozilla thing or is it how you code it?

Code: [ Select ]
<BODY onLoad="clock()">
<span id="pendule" class="styling"></span>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function clock() {
if (!document.layers && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds;
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
// End -->
</script>
  1. <BODY onLoad="clock()">
  2. <span id="pendule" class="styling"></span>
  3. <SCRIPT LANGUAGE="JavaScript">
  4. <!-- Begin
  5. function clock() {
  6. if (!document.layers && !document.all) return;
  7. var digital = new Date();
  8. var hours = digital.getHours();
  9. var minutes = digital.getMinutes();
  10. var seconds = digital.getSeconds();
  11. if (hours == 0) hours = 12;
  12. if (minutes <= 9) minutes = "0" + minutes;
  13. if (seconds <= 9) seconds = "0" + seconds;
  14. dispTime = hours + ":" + minutes + ":" + seconds;
  15. if (document.layers) {
  16. document.layers.pendule.document.write(dispTime);
  17. document.layers.pendule.document.close();
  18. }
  19. else
  20. if (document.all)
  21. pendule.innerHTML = dispTime;
  22. setTimeout("clock()", 1000);
  23. }
  24. // End -->
  25. </script>
  • peterstannard
  • Beginner
  • Beginner
  • peterstannard
  • Posts: 40

Post 3+ Months Ago

have you got a link to the page that has the clock?

peter
  • khayoz
  • Beginner
  • Beginner
  • khayoz
  • Posts: 44
  • Loc: Australia

Post 3+ Months Ago

Yeah: http://www.skizzers.org/khayoz/main.html It only works in the main page, i have still update the rest of the pages.
  • Sumen
  • Proficient
  • Proficient
  • User avatar
  • Posts: 421
  • Loc: Rochester or Albany, NY

Post 3+ Months Ago

im not seeing it in IE or FF?
  • khayoz
  • Beginner
  • Beginner
  • khayoz
  • Posts: 44
  • Loc: Australia

Post 3+ Months Ago

I can see it in IE. Hmm. Anyone?
  • cubechris
  • Graduate
  • Graduate
  • User avatar
  • Posts: 247
  • Loc: Gloucester, UK

Post 3+ Months Ago

where on the page is it meant to be appearing?
  • khayoz
  • Beginner
  • Beginner
  • khayoz
  • Posts: 44
  • Loc: Australia

Post 3+ Months Ago

It should be appearing at the bottom right of the text box, it should work now.
  • cubechris
  • Graduate
  • Graduate
  • User avatar
  • Posts: 247
  • Loc: Gloucester, UK

Post 3+ Months Ago

yes it works now even in FF, so did you have to edit the code for it to work?
  • khayoz
  • Beginner
  • Beginner
  • khayoz
  • Posts: 44
  • Loc: Australia

Post 3+ Months Ago

Yeah, I have changed the date and time (the date im still woking on), i used my old clock and added in the seconds, very relived that it worked. Thanks guys.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 24 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.