[thelist] IE equivalent in netscape

Peter-Paul Koch gassinaumasis at hotmail.com
Sun Feb 18 04:45:34 CST 2001

>is there a Netscape 4 equivalent for
>IE eg:
>document.all.thetext.style.fontSize = fontpitch;

document.layers['thetext'].fontSize = fontpitch

Unfortunately it won't work. Generall, document.layers is the NN4 equivalent 
of document.all, while document.getElementById is the NN6 equivalent.

See http://www.xs4all.nl/~ppk/js/index.html?dom.html for an introduction to 
the three advanced DOMs

After you've understood these DOMs you'll notice that some effects still 
won't work in Netscape 4. That's because it's an old fashioned browser that 
simply cannot do many things.


No, not in NN4. innerHTML works fine in NN6.

>I have one page that "reads" the text for the user - by highlighting a word
>and then moving to the next word - etc. to the end.  code in IE with each
>word given a span id of w1, w2 etc.  Netscape says that w1 is undefined.
>Apparently the o.style...  statement is not supported by netscape??
>Anything else I could use here??
>    wordcount = wordcount + 1;
>     var o = eval("w" + wordcount);
>    o.style.backgroundColor="a0a0a0";

No, should be


No 'style.' in Netscape 4, but it probably won't work either. NN4 is really 
very old and bad. Don't bother about NN4, make it work in NN6 and it should 
be allright in the long term.


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

More information about the thelist mailing list