Link to home
Start Free TrialLog in
Avatar of callmeal
callmeal

asked on

Passing frame contents from link

I have a simple two-panel frame setup, with several pages designed for each panel.
I have another page with several links (not live yet), each representing a different set of left and right panels in this frame.
What I'm after is a way of having each link use the same frame URL and pull the varying left and right panels into it, rather than having to set up a different frame for each link.
Seems like it shouldn't be difficult... suggestions, anyone?

Thanks!
Avatar of stebesplace
stebesplace

Set your Target to this on the links. .

<span lang="en-us">
<a target="_self" href="index.htm">Test Link</a></span>

-Steve
From: http://www.htmlhelp.com/faq/html/frames.html#frame-update2

 There are two basic techniques for updating multiple frames with a single link: The HTML-based technique links to a new frameset document that specifies the new combination of frames. The JavaScript-based solution uses the onClick attribute of the link to update the additional frame (or frames).

The HTML-based technique can link to a new frameset document with the TARGET="_top" attribute (replacing the entire frameset). However, there is an alternative if the frames to be updated are part of a nested frameset. In the initial frameset document, use a secondary frameset document to define the nested frameset. For example:

<frameset cols="*,3*">
    <frame src="contents.html" name="Contents">
    <frame src="frameset2.html" name="Display">
    <noframes><body>
        <!-- Alternative non-framed version -->
    </body></noframes>
</frameset>

A link can now use the TARGET="Display" attribute to replace simultaneously all the frames defined by the frameset2.html document.

The JavaScript-based solution uses the onClick attribute of the link to perform the secondary update. For example:

<a href="URL1" target="Frame1" onClick="top.Frame2.location='URL2';">Update frames</a>

The link will update Frame1 with URL1 normally. If the reader's browser supports JavaScript (and has it enabled), then Frame2 will also be updated (with URL2).
Avatar of callmeal

ASKER

Thanks, Steve... if I'm reading that correctly, I need to be a bit clearer on my question.
I'm reading your code as a request to load index.htm in the current window when a link displayed as 'Test Link' is selected.  So far so good, but unless I'm missing it, the attribute I'm looking for isn't there.
What I have is an unframed page; call it start.htm.  It has on it several links that would ideally all connect to my frame document - let's go on calling it index.htm - but would allow the two pages for the left and right frames of index.htm to be specified within the link, rather than going with the default frame contents specified within index.htm.  So Link 1 on start.htm goes to index.htm and tells it to display pages A and B, Link 2 also goes to index.htm but tells it to display pages C and D, and so forth.
Sorry for the confusion.
Avatar of Dean OBrien
You could store index  as an asp page, then have each link post different variables to the page (i.e. url1 and url2).  

The asp page would then dynamically create the new index page substituing the url's in the appropriate places.

(not very clear, I know, but it should work)
Ok let me try to be more specific with the examples you have given.

First let me clear up my understanding.

You have a page: start.html
You have a layout of the 'web' being two frames in the middle so to speak, with two on the edge, like this:

|+++++|+++++++++++++++++++|+++++|
|     |                   |     |
|     |     index.htm     |     |
|     |                   |     |
|a.htm|+++++++++++++++++++|b.htm|
|     |                   |     |
|     |     start.htm     |     |
|     |                   |     |
|+++++|+++++++++++++++++++|+++++|

Now, you have a link on start.htm that opens a new page, index.htm.

wait a sec. . .

scratch all that crap above. . .

I think i see what you mean.
start.htm has a link that links to index.htm
when index.htm loads, you want the pages that load with that index.htm to be chosen wether right or left.

err. . .ok, its easier if i just make it and then explain it. I am going to make it now, 9:04 pm, friday night EST. I will post my results shortly.

-Steve
You know, i don't think its all entirely possible. Well maby it is. i can't seem to be able to get it. I am going to try a java script routine to see if that will do it.

-Steve
Steve, thanks for your efforts here.  I appreciate your time and thought, and if you have any further thoughts I'd love to hear them.

dorward, thanks for the htmlhelp.com reference.  I'm familiar with the site, but didn't find anything there with a more direct bearing on my situation than what you posted here, which is related but not directly applicable.

easynow111, the asp solution sounds to me like it would do what I'm after.  Only hitch is that I am almost completely ignorant of asp, so it's effectively out of my reach at present.  Is this something you can describe in a way I could apply?
ASKER CERTIFIED SOLUTION
Avatar of Dean OBrien
Dean OBrien
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry for the delay.  I've been looking into ASP and making sure this solution works for me.  (It does.)  Thank you!

Many thanks to all who commented here.  I appreciate your help!
Cheers