Solved

Frames from multi-book index

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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

685 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