Updating three frames at once - Different frame handling in NS and IE (Posted by robr)
I am trying to update three frames at once using javascript. The user clicks on a graphic in frame 'main', and updates this frame and two others, 'search' and 'chapter'.
The html of frame 'main' contains an OnClick event of the form:
<a href="#nowhere" onclick="parent.frame_update ('bla.html', 'blabla.html', 'blablabla.html')"><img height="31" width="40" src="graphic.jpg" border="0"></a>
which calls the following function, in the frameset document:
function frame_update (url1,url2,url3) {
{{parent.chapter.location.href=url1;}
{parent.main.location.href=url2;}
{{parent.search.location.href=url3;}
With IE 4 and 5, all three frames update fine. With Netscape 4.5, frames 'chapter' and 'search' update, but 'main' does not.
I've tried different permutations of 'parent' 'self' and so on in the function, but the bottom line seems to be that Netscape does not want to update the frame that contains the OnClick event.
You can see this in action at
Where the 'QuickIndex' function works fine in IE but not in NS!
Any help would be VERY welcome!
Ian posted this at 22:55 — 28th October 1999.
They have: 67 posts
Joined: Aug 1999
oh, so much code to do so little. This works for me in IE and NS
just put this in your <a href="">
javascript:parent.Frame2.location='page2.html';parent.Frame3.location='page3.html'
so it looks like this:
<a href="javascript:parent.Frame2.location='page2.html'; parent.Frame3.location='page3.html'"><img height="31" width="40" src="graphic.jpg" border="0"></a>
Oh, thats to open 2 windows, just add as many as you want and put a ; in between. Change Frame2 etc. to the name of your frame name and the location to the page you are loading.
good luck.
Ian
Webmaster A1 JavaScripts
A1 JavaScripts
Web Development - Big Resources Inc
BIG Resources.com
robr posted this at 23:26 — 28th October 1999.
They have: 3 posts
Joined: Sep 1999
Thanks Ian!
That works fine - the only problem is that the code is supposed to work with an index with hundreds of entries, so having a function would save a lot of space. Is there a version of your code that would work as a function?
Logic-wise, your solution just looks like my function code put into the body of the html. Do you have any idea why this works but the function doesn't work??
Ian posted this at 01:09 — 29th October 1999.
They have: 67 posts
Joined: Aug 1999
Hi,
if possible, can you post the URL please?.
Or email it to me.
Thanks.
Ian
robr posted this at 03:38 — 30th October 1999.
They have: 3 posts
Joined: Sep 1999
A working example of the code that I'm having problems with is at
http://www.natureexplorer.com/birds.html
This is a frame on the page
http://www.natureexplorer.com/index.html
Thanks again!
Rob
randygordjr posted this at 21:28 — 16th December 1999.
They have: 15 posts
Joined: Dec 1999
Ian, I'm preety new to this JavaScript stuff. Would you exlpain this code to me.
[This message has been edited by randygordjr (edited 16 December 1999).]
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.