[thelist] writing to DIV in NS

david lloyd parker david at image2image.co.uk
Tue Jan 29 07:03:00 CST 2002


This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Help! I'm trying to write a variable from a function which includes the following statements to a DIV named tick2. The following extracted script, initialised on load, works fine in IE & NN6, but I get a 'document.tick2 has no properties' error in NN4. Can anyone help please?

if (document.all && !document.getElementById) {
     //IE 4 supports document.all but NOT document.getElementById
     tick2.innerHTML = ctime;
} else if (document.layers) {
     //Netscape 4 only browser that supports document.layers
    document.tick2.document.write(ctime);
    document.tick2.document.close();
} else if (document.getElementById) {
     //Works for Netscape 6 and IE 5
     document.getElementById("tick2").innerHTML = ctime;
} else {
     //If browser is none of the above;
 }
--




More information about the thelist mailing list