Click to See Complete Forum and Search --> : script not working in netscape


Gunner
06-01-2003, 01:54 PM
I cant seem to get certain scripts to work in netscape but they work fine in IE example:
<script language="javascript" type="text/javascript">
function changeBackColorA()
{
if (document.form1.button1.style.backgroundColor
== "#00c6bd")
document.form1.button1.style.backgroundColor
= "#40FF40"
else
document.form1.button1.style.backgroundColor
= "#00c6bd"
}
</script>
<form action="../action/return.html" method="get"
enctype="application/x-www-form-urlencoded"
name="form1"
id="form1">
<input style="background-color: #00c6bd;
color: #000000;
font-weight: bold;font-size: 14pt;
font-family: arial; width:92px; height:30px" type="button" value="Home"
onmouseover="changeBackColorA(this)" onmouseout="changeBackColorA(this)"
name="button1"
id="button1" onClick="parent.location='http://www.thegunnersgallery.com'"
/>
</form>
This works fine in IE

How do I get it to work in netscape?
I have other scripts that dont work in netscape.

If you use they code above I had to put a bunch of line breaks to keep it from right scolling this post

Charles
06-01-2003, 02:07 PM
Originally posted by Gunner
... but they work fine in IE Actually, it fails for between 7 and 13% of MSIE users. But from what I see, your script is just fluff. Your page will run fine without so don't worry about it. Netscape represents perhaps 4% of users.

But if you must, know that the interface between JavaScript and the web page is known as the document object model (DOM) - and there are three of those. Netscape 4 and MSIE each have their very own DOMs and then there is a W3C DOM that is supported by the current versions of Microsoft, Netscape and Opera. Which versions of which browsers concern you?

Gunner
06-01-2003, 02:19 PM
Your right, it is fluff, the linking part works and (your right again) about 3% of my visitors use netscape.
Idealy I would like it to work across all browsers, but the latest versions will do if at all (it just bugs me that it doesnt). Also I have a javascript nav bar that I call from an external script that doesnt work in netscape 7. Is there any code that will let netscape see it? How would I incorporate the W3C DOM I'm just learning javascript so bear with me.

Charles
06-01-2003, 02:29 PM
Originally posted by Gunner
Also I have a javascript nav bar that I call from an external script that doesnt work in netscape 7.That is bad, very bad. The whole problem / challenge is that about 13% of users do not use JavaScript at all. That number includes persons, like myself, who simply cannot stand their windows being resized but it also includes persons who cannot use JavaScript because of their disabilities. It is very important, and at times required by law, that your page work without JavaScript. You'll need to rethink your navigation.

I'm no expert in the W3C DOM, or of JavaScript for that matter, but I wonder how well MSIE 5 handled it. If you switch to the W3C DOM to pick up that 3% of late model Netscape users then you might loose the 34% that represents the MSIE 5 users.