General Question

stephen's avatar

My JavaScript code doesn't work in Firefox?

Asked by stephen (351points) January 22nd, 2008

————frames—————

<frameset cols=”,100,” frameborder=“no” border=“0” framespacing=“0” id=“alls”>
<frame src=“http://www.google.com” name=“leftFrame” id=“leftFrame” />
<frame src=“menu.html” name=“mainFrame” id=“mainFrame” />
<frame src=“http://www.yahoo.com” name=“rightFrame” id=“rightFrame” />
</frameset>
<noframes><body>
</body>
</noframes>

————menu.html————-

<script type=“text/javascript”>
function change(dic)
{
var cons=parent.document.getElementById(“alls”).cols;
if(dic==“left”)
{
if(cons==”,100,”)
cons=“0,100,*”;
else
if(cons==”*,100,0”)
cons=“0,100,*”;
else
if(cons==“0,100,*”)
cons=”,100,”;
}
if(dic==“right”)
{
if(cons==”,100,”)
cons=”*,100,0”;
else
if(cons==”*,100,0”)
cons=”,100,”;
else
if(cons==“0,100,*”)
cons=”*,100,0”;
}
parent.document.getElementById(“alls”).cols=cons;
}
</script>

…........

<div> <a href=”###” onclick=“change(‘left’)”>left open/close</a></div>
<div><a href=”###” onclick=“change(‘right’)”>right open/close</a> </div>

Observing members: 0 Composing members: 0

4 Answers

glial's avatar

Frames…haven’t seen those in a long time.

row4food's avatar

javascript has to be enabled in firefox…go to Tools>Options

ben's avatar

I’d also highly recommend Firebug for debugging in Firefox—it has a great javascript console which actually shows errors and let’s you play with things.

segdeha's avatar

First thing I notice is that you don’t have return false; in your onclick attributes. If you click on something, it’s going to reload the frame after your JavaScript runs.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther