Click to See Complete Forum and Search --> : IE vs NS


emmanuellamy
08-15-2003, 01:20 AM
Hi everybody,
I want to code in the content of a Div element on a web page I am writing for "IE 4 and up" and "NS 6 and up" browsers, in an approach similar to the one shown below. Everything works fine with the IE browsers. But, when I try to open the page in a NS 7.x browser, for some obscure reason, I keep receiving the error message "document.showad has no properties". Here is how I laid it out:

if (document.all)
{
showad.innerHTML="<font face= 'MyFontFace' color='MyFontColor' size='MyFontSize'><P Align='Center'> Some text here</P></font>";
}

if (document.layers)
{
document.showad.document.write("<font face= 'MyFontFace' color='MyFontColor' size='MyFontSize'><P Align='Center'> Some text here</P></font>");
document.showad.document.close();
}

I tried document.ids.showad.document.write(). Still didn't work. Any help will be appreciated. TIA.

Emmanuel

Fang
08-15-2003, 02:19 AM
NS 7 does not support "document.layers".
Use if (document.all || document.getElementById)

emmanuellamy
08-15-2003, 02:22 AM
Appreciate your tips. Thanks.

Emmanuel