Gossamer Forum
Home : General : Internet Technologies :

Firefox won't accept getElementById ?

Quote Reply
Firefox won't accept getElementById ?
Hi,

Got a problem with some javascript I've just written :(

It looks like;

Code:
<script language="JavaScript">
<!-- Begin
function docheck() {
var isIE = false;
var isNav = false;
if (navigator.appName == "Netscape") {
isNav = true
} else {
isIE = true
}

if (isIE) {
document.getElementById('loadingdiv').style.display = 'none';
document.getElementById('downloadit').style.display = 'block';
}

if (isNav) {
document.getElementById('loadingdiv').style.display = 'none';
document.getElementById('downloadit').style.display = 'block';
}

alert("Browser: " + navigator.appName);

}
// End -->
</script>
<body class="body_1col" onload="javascript: docheck()">

Basically, when the page loads... docheck() is run, and decides it its an IE or Mozilla browser.

This part works fine in IE... but not FireFox;

Code:
document.getElementById('loadingdiv').style.display = 'none';
document.getElementById('downloadit').style.display = 'block';

Anyone got any ideas? (I'm basically trying to make a "loading" div, which gets shown while the page loads, and then dissapears after its finished ... revealing the main div, which has the content in it :)).

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Firefox won't accept getElementById ? Andy 9536 Sep 8, 2005, 8:35 AM
Thread Re: [Andy] Firefox won't accept getElementById ?
Andy 9330 Sep 8, 2005, 11:10 PM
Post Re: [Andy] Firefox won't accept getElementById ?
bullfrog 9115 Sep 26, 2005, 9:43 PM