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
Solved

Frames from multi-book index

Posted on 1997-06-09
4
182 Views
Last Modified: 2013-12-25
Hi, I have a set of links in an html file, an index file actually, that appears in a right-hand frame. The index is a composite set of entries from three different books. The left-hand frame in the set is a list of topics for one of the books. When a user clicks on one of the index entries that pertains to one of the other two books, I want the left-hand to display the list of topics for that book. No big deal, right, just have <TARGET="_top" ...> link to another html file with a different frame set.

But in addition to changing the left-hand frame, I want the right hand frame to go to the *exact* file that the index entry is pointing to, not just the starting default file of the new html/frame file. In other words, the right-hand frame should display any of several hundred files, depending on which entry is selected, while the left-hand frame should display the correct one of three topic files, depending on which book the right-hand file belongs to.

Any way to do this? Any help would be greatly appreciated.

thanks
0
Comment
Question by:sstark
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Hawke
ID: 1854303
Try using the anchor tag.
<A HREF="myfile.html#here"> This will be linked to the "here" section of "myfile.html".</a>

<A NAME="here"> "Here" section of "myfile.html". </a>

I hope you understood that. The link will pull up the "here" section of "myfile.html". You'll have to edit your entries though and I don't think you want to do that.
0
 

Author Comment

by:sstark
ID: 1854304
Sorry Hawke, but your response doesn't say anything about how to target a specific file within a new frame set. Perhaps my question isn't clear. I want both the left and right-hand frames to change, the left one to one of three files and the right to one of possibly thousands of files.

thanks,
Scott
0
 
LVL 4

Accepted Solution

by:
jshamlin earned 100 total points
ID: 1854305
There are two different ways to go about "sapping" two frames at once ...

First, if the frames are tangent (which it seems they are), you can create a different framed document to replace the entire document, with specific content loaded into each frame.

This is, granted, labor intensive, because not only do you have to create the content,. you have to create a unique framed document for each possible combination.

A better way, which will work even for non-tangent frames, is to use a JavaScript routine that will cause the proper "menu" to load in the right frame as soon as the left frame finishes loading.

To be specific, in the <HEAD> of the document in the right frame, include this ...

function loadMenu(){
     parent.right_frame_name.document.location =
       'path/proper_menu_file.html';
     }

Replace right_frame_name with the NAME of the FRAME as defined in the FRAMESET construction and path/proper_menu_file.html with the path and name of the file you want to load in the right column when the page on th left loads.

Finally, include onLoad="loadMenu" in the BODY tag of the left document.

The limitation to this, of course, is that only JavaScript-capable browsers (Netscape 2 or later, MSIE 3 or later - I think there are a few "odd" otehrs) will execute the function - but as there's no effective method to targeting external scripts, it's your only "automated" alternative to the laborious task of creating unique framesets for every possible combination.
0
 

Author Comment

by:sstark
ID: 1854306
Thanks for the great answer!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

829 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