Solved

Frames from multi-book index

Posted on 1997-06-09
4
184 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

737 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