problems with a script in FF

T

tinyhunter

Maybe I am just blind. The following http://cresslawnprimary.co.za/news.html
works in IE and Opera fine. I can change via the pull down the news
and it works. But in FireFox it just does not work and the error I see
in Firebug is:

parent.frames.XYZ1 has no properties
http://cresslawnprimary.co.za/drop.html?
Line 7


the code looks as follows:


function gotourl( mySelect ) {
myIndex = mySelect.selectedIndex;
myValue = mySelect.options[myIndex].value;
parent.frames.XYZ1.location=myValue;
}

function gotour2(Ref1) {

myElem=document.getElementById("SelBox1");
myElem.selectedIndex = Ref1 ;
myValue = myElem.options[Ref1].value;
parent.frames.XYZ1.location=myValue;

}



</script>

<title></title>
</head>

<body>
Select newsletter to view: &nbsp; &nbsp; &nbsp; Latest: &nbsp;
&nbsp; &nbsp; <a href="javascript:gotour2(0)">17 May 2007</a> &nbsp;
&nbsp; &nbsp; <a href="javascript:gotour2(1)">03 May 2007</a>
&nbsp; &nbsp; &nbsp; <a href="javascript:gotour2(2)">18 Apr 2007</a>
&nbsp; &nbsp; &nbsp; All: &nbsp; &nbsp; &nbsp; <select id="SelBox1"
onchange="gotourl(this)">
<option value="NewsLetters/17 May 2007.html" selected>
17 May 2007
</option>

<option value="NewsLetters/03 May 2007.html">
03 May 2007
</option>

<option value="NewsLetters/18 Apr 2007.html">
18 Apr 2007
</option>

<option value="NewsLetters/15 Mar 2007.html">
15 Mar 2007
</option>

<option value="NewsLetters/01 Mar 2007.html">
01 Mar 2007
</option>

<option value="NewsLetters/16 Feb 2007.html">
16 Feb 2007
</option>

<option value="NewsLetters/01 Feb 2007.html">
01 Feb 2007
</option>

<option value="NewsLetters/18 Jan 2007.html">
18 Jan 2007
</option>
</select>
</body>
</html>


Any ideas, where I am blond in regards to the script

Thx,

Marcus
 
J

Janwillem Borleffs

Any ideas, where I am blond in regards to the script

The reference to parent.frames.XYZ1 is invalid, because a) you are not
working in frames, and b) you didn't give the document the name XYZ1.


JW
 
T

TinyHunter

there was one more file to go with it:

news.html

<html>
<head>
<Title>Cresslawn Primary Newsletters</Title>
</head>
<frameset rows=130,30,*>
<frame frameborder=10 src="head.html?" </frame>
<frame marginheight=0 frameborder=0 src="drop.html?" </frame>
<frame id="XYZ1" marginheight=0 frameborder=0 src="NewsLetters/17 May
2007.html"
</frame>
</frameset>
</html>

what realy cobfuses me is the fact it runs in Opera and IE..
 
J

Janwillem Borleffs

TinyHunter said:
what realy cobfuses me is the fact it runs in Opera and IE..

Change ``<frame id="XYZ1" '' into ``<frame name="XYZ1" ''; Both Opera and IE
probably use the id in absence of a name attribute.


JW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,730
Latest member
AudryNolan

Latest Threads

Top