Hi,
Got a problem with some javascript I've just written :(
It looks like;
<!-- 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;
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!
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!