Forum Moderators: open

Message Too Old, No Replies

Javascript problem in firefox, not in IE

Javascript error 0x80004005 in firefox

         

irish villan

5:29 pm on Nov 17, 2005 (gmt 0)

10+ Year Member



Having problems with javascript rendering in Firefox, though it works fine in IE. As you will see from [bay.ie...] in Firefox the buttons on the right hand side are useless, and the second button down doesnt even change colour in response to onMouseOver()

The javascript console in Firefox gives the error
"Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" :"JSFrame...line 24"
Gives the same error again, but on line 32.

Line 24:
document[menuNames[i]].src = "images/"+menuNames[i]+"_on.gif";

Line 32:
document[menuNames[i]].src = "images/"+menuNames[i]+"_off.gif";

Any help appreciated...

Fotiman

6:10 pm on Nov 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



location is a property of document, thus you're doing:

document[location].src = ...

And that's causing problems. Instead, try this:

function turnOn(i)
{
if(document.images)
{
document.images[menuNames[i]].src = "images/"+menuNames[i]+"_on.gif";
}
}

function turnOff(i)
{
if(document.images)
{
document.images[menuNames[i]].src = "images/"+menuNames[i]+"_off.gif";
}
}

irish villan

1:04 am on Nov 20, 2005 (gmt 0)

10+ Year Member



Appreciate the reply, but didnt resolve the issue. Each button action is defined as follows:

<TR>
<TD>
<A HREF="javascript:clicked(1)" onMouseOut="turnOff(1)" onMouseOver="turnOn(1)"><IMG BORDER="0" width="150" height="50" SRC="images/location_off.gif" NAME="location">
</A>
</TD>
</TR>

Is there anything omitted here that could cause the issue?

Fotiman

5:25 pm on Nov 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well, the easy solution would be simply to rename your "location" link to something else. Otherwise, I'm not sure what to tell you.

irish villan

5:40 pm on Nov 21, 2005 (gmt 0)

10+ Year Member



Got it sorted. Changed "NAME" to "ID" and then used the getElementById() to reference it - apparently this is part of the W3C standard not needed for current version of IE. Thanks for the help