Solved

Frames from multi-book index

Posted on 1997-06-09
4
178 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the great answer!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now