?
Solved

Passing frame contents from link

Posted on 2003-02-20
10
Medium Priority
?
184 Views
Last Modified: 2010-04-09
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
Comment
Question by:callmeal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +1
10 Comments
 

Expert Comment

by:stebesplace
ID: 7987937
Set your Target to this on the links. .

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

-Steve
0
 
LVL 17

Expert Comment

by:dorward
ID: 7988343
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
 

Author Comment

by:callmeal
ID: 7988543
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
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 
LVL 12

Expert Comment

by:Dean OBrien
ID: 7993957
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
 

Expert Comment

by:stebesplace
ID: 7996840
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
 

Expert Comment

by:stebesplace
ID: 7996921
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
 

Author Comment

by:callmeal
ID: 8009335
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
 
LVL 12

Accepted Solution

by:
Dean OBrien earned 200 total points
ID: 8015305
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
 

Author Comment

by:callmeal
ID: 8065682
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
 
LVL 12

Expert Comment

by:Dean OBrien
ID: 8065730
Cheers
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question