Click to See Complete Forum and Search --> : Loading two frames with one hyperlink


scottrie
07-22-2003, 10:02 AM
I have a intranet site that is set up with frames. Sometimes I have two frames . But then sometimes I have 3 frames [banner (top15%), left(20%) and right(80%)]. I accomplish this by creating a frame page with two frames -- top 20 and bottom 80. Then, when I need two frames I target the "bottom" frame. When I want 3 frames I load another frameset into the "bottom" frame with "left" and "right" as potential targets.

When I have three frames showing, I need to load the "top" and "bottom" frames at the same time with one hyperlink.

I downloaded the following script:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function loadFrames(frame1,page1,frame2,page2) {
eval("parent."+frame1+".location='"+page1+"'");
eval("parent."+frame2+".location='"+page2+"'");
}
// End -->
</script>

The script is called by:
<a href="javascript:loadFrames('Top', 'Page1.htm', 'Bottom', 'Page2.htm')">
This script doesn't work in my situation. Currently I get a message on the status bar saying Error on Page. I think this is because of the one frameset is targeting another frame set which throws off the "parent" part of the script.

Detail file names etc.:
Main.htm (Frameset)
[B]Top that loads banner.htm
Bottom loads info.htm

Info.htm has a link to insurance.htm targeting Bottom.

insurance.htm (frameset)
Left that loads linktypes.htm
Right that loads links.htm

When I click on a hyperlink on the links page I want to load:
Page1.htm targeting Top
Page2.htm targeting Bottom

Any Ideas! If there is a better way to do this I can redo the whole site if necissary (I'm in the beginning stages).

sumyounguy
07-22-2003, 10:16 AM
<a href="#" onclick="top.location='banner.htm';bottom.location='info.htm'">

scottrie
07-22-2003, 10:59 AM
I'm not sure if there was a typo, but this didn't work. Is there supposed to be a " after the #?

And I assume you meant:

<a href="#" onclick="top.location='page1.htm';bottom.location='page2.htm'">

If not, I am not sure how to implement the post.