Solved

Frames from multi-book index

Posted on 1997-06-09
4
185 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
[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
  • 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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

689 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