[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

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!
0
callmeal
Asked:
callmeal
  • 3
  • 3
  • 3
  • +1
1 Solution
 
stebesplaceCommented:
Set your Target to this on the links. .

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

-Steve
0
 
dorwardCommented:
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).
0
 
callmealAuthor Commented:
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.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Dean OBrienCommented:
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)
0
 
stebesplaceCommented:
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
0
 
stebesplaceCommented:
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
0
 
callmealAuthor Commented:
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?
0
 
Dean OBrienCommented:
I have only just recently played about with ASP, but from my understanding, you would have something like;

<%
  UserID = Request("ID")
  url1 = Request("url1")
  url2 = Request("url2")

  IF UserID = "abc" Then
      Response.Write("<HTML><HEAD>index.html</HEAD><BODY>")
            //....body content (i.e framesets)...//
      Response.write("</BODY></HTML>")
  Else
            //...suitable access denied page...//
  End if
%>

This is in the most simple form!! UserID, url1, url2 posted to page.  Anyway none of this code would appear if the user typed in the address.  

You might consider using ASP, it really doesnt take long to learn! (hope this helps!)
0
 
callmealAuthor Commented:
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!
0
 
Dean OBrienCommented:
Cheers
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now