...

View Full Version : can one link load 2 frames plus their frameset?



craigr7
01-02-2012, 06:29 AM
With the help of Aerospace_Eng in a 2005 codingforums thread, now I can use one link (for example in a page about Topic 3) to load two related pages about Topic 4 (left-4.htm and right-4.htm) into the “left” and “right” iframes, using the code below.
___Is it possible to use this code, suitably supplemented, to also specify the frameset at “home.htm” if an external link to “right-4.htm” loads it into a browser without the frameset? (i.e. by putting a link into right-4.htm that will load it and left-4.htm into the iframe-context of home.htm)

<head>
<script> function changeLink(link) { parent.right.location=link; } </script>
</head>
<body>
<a href="left-4.htm" target="left" onclick="changeLink('right-4.htm'); return true">for Topic 4</a>
</body>

Old Pedant
01-02-2012, 06:36 AM
If you are talking about loading a <frameset> into the top window, then doing so WIPES OUT all other content, including anything you were trying to put in the left and right frames.

So what's the point in specifying the left and right frames if the frameset load will wipe them out?

What am I missing in your question?

craigr7
01-02-2012, 06:58 AM
If you are talking about loading a <frameset> into the top window, then doing so WIPES OUT all other content, including anything you were trying to put in the left and right frames.
Could it first load the missing frameset (home.htm) into a new window (as occurs with target="blank") while it's "remembering" the commands -- to load 4-left.htm into the left-frame, and 4-right.htm into the right-frame -- so that, after the frameset is available, it can do these two link-commands? Or is this type of "remembering with delayed actions" impossible?

Old Pedant
01-02-2012, 08:07 AM
Yes, two ways:

(1) Set a session cookie and then read it from the frameset page. Requires minimal cookies to be enabled.
(2) Pass the information in the query string to the frameset page and have that page be ready to process the query string.

e.g.,


top.location.href="myFrameSet.html?left=xyz.html&right=abc.html

And now you just need some minimal parsing of location.search in "myFrameSet.html".

Will that work for you?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum