login  Naam:   Wachtwoord: 
Registreer je!
 Forum

[JavaScript] klok niet in FireFox

Offline JdeBoer - 19/11/2004 15:43
Avatar van JdeBoerLid hallo mensen

ik heb de volgende code:

  1. <script language="JavaScript" type="text/javascript">
  2. <!--
  3. function clock() {
  4. if (!document.layers && !document.all) return;
  5. var today = new Date();
  6. var day = today.getDate();;
  7. var month = today.getMonth() + 1;
  8. var year = today.getFullYear().toString();
  9. var hours = today.getHours();
  10. var minutes = today.getMinutes();
  11. var seconds = today.getSeconds();
  12. var dayname = new Array ("Zo","Ma","Di","Wo","Do","Vr","Za");
  13. var monthname = new Array ("jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec");
  14. if ( (day/10)<1)
  15. {
  16. day=("0" + today.getDate()).toString();//add the leading 0 -- looks better
  17. }
  18. if ( ( month /10 ) < 1 )
  19. {
  20. month=("0" + month).toString(); //add the leading 0 -- looks more professional
  21. }
  22. if (year < 2000) year+=1900;
  23. if (hours <= 9) hours = "0" + hours;
  24. if (minutes <= 9) minutes = "0" + minutes;
  25. if (seconds <= 9) seconds = "0" + seconds;
  26. dispTime = day + " " + monthname[month - 1] + " " + year + " " + hours + ":" + minutes + ":" + seconds;
  27. if (document.layers) {
  28. document.layers.pendule.document.write(dispTime);
  29. document.layers.pendule.document.close();
  30. }
  31. else
  32. if (document.all)
  33. pendule.innerHTML = dispTime;
  34. setTimeout("clock()", 1000);
  35. }
  36.  
  37. //-->
  38. </script>

maar dan zie je niet de datum en de tijd in FireFox, wel in IE en NetScape.
het voorbeeld staat op FilmArchief online
wie kan mij hiermee helpen?

alvast bedankt!

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.202s