Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

running scripts on web page

  • 1 απάντηση
  • 1 έχει αυτό το πρόβλημα
  • 8 προβολές
  • Τελευταία απάντηση από cor-el

more options

why won't fire fox show this script when accessing a web page... it works in IE...

<SCRIPT LANGUAGE="JavaScript">

function displaydatetime() {
if (!document.layers && !document.all)	return;
  var today;
  var timeLocal;
  var timeUTC;
  today = new Date();
  timeLocal = today.toLocaleString(); 
  timeUTC = today.toUTCString(); 
  if (document.layers) {
    document.layers.clockLocal.document.write(timeLocal);
    document.layers.clockLocal.document.close();
    document.layers.clockUTC.document.write(timeUTC);
    document.layers.clockUTC.document.close();}
  else if (document.all) {
  clockLocal.innerHTML = timeLocal;
  clockUTC.innerHTML = timeUTC;}
  setTimeout("displaydatetime()", 500)
}
  window.onload = displaydatetime;

</script>

or this...

<a href="http://www.pax.com/free-counters.html"><img src="http://counter.pax.com/counter/image?counter=ctr-9hkgqsxvvq" alt="Free Hit Counter" border="0" /></a>

Thanks

why won't fire fox show this script when accessing a web page... it works in IE... <pre><nowiki><SCRIPT LANGUAGE="JavaScript"> function displaydatetime() { if (!document.layers && !document.all) return; var today; var timeLocal; var timeUTC; today = new Date(); timeLocal = today.toLocaleString(); timeUTC = today.toUTCString(); if (document.layers) { document.layers.clockLocal.document.write(timeLocal); document.layers.clockLocal.document.close(); document.layers.clockUTC.document.write(timeUTC); document.layers.clockUTC.document.close();} else if (document.all) { clockLocal.innerHTML = timeLocal; clockUTC.innerHTML = timeUTC;} setTimeout("displaydatetime()", 500) } window.onload = displaydatetime; </script></nowiki></pre> or this... <pre><nowiki><a href="http://www.pax.com/free-counters.html"><img src="http://counter.pax.com/counter/image?counter=ctr-9hkgqsxvvq" alt="Free Hit Counter" border="0" /></a> </nowiki></pre> Thanks

Τροποποιήθηκε στις από το χρήστη cor-el

Όλες οι απαντήσεις (1)

more options

That is a very old script: if (!document.layers && !document.all) return;

Firefox doesn't support either of them, document.layers is old Netscape code and document.all is IE code, so Firefox does return.

In modern browsers you need to use document.getElementById
See https://developer.mozilla.org/En/DOM/document.getElementById