/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 15.2003 — NS 7 does not support "document.layers".

Use [COLOR=green]if (document.all || document.getElementById)[/COLOR]
Copy linkTweet thisAlerts:
@emmanuellamyauthorAug 15.2003 — Appreciate your tips. Thanks.

Emmanuel
×

Success!

Help @emmanuellamy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...