tutorial home

FAQ (Frequently Asked Questions)

Why can't I bookmark framed pages?

When you are viewing framed sites, you may have difficulty bookmarking some pages. This is because, quite often, the main URL for a framed page does not change even though the individual frames may be updating as you navigate your way through the content. When you bookmark a frameset document, and then return to it later, the browser will load the initial frames for that frameset, which may not be frames that were visible at the time you created the bookmark.

As you build framed sites, you should be aware that your visitors may have this problem and attempt to minimize the frustration this may cause. One way around it is to make every link target _top and point to a new frameset. Each linked frameset would then be identical to the referring frameset except for one or two frames that change. (This is also how you can make links update more than one frame at a time -- or at least make it appear to do so.) This technique, however, can cause an explosion in the number of documents that make up your site, because you must maintain a frameset for every combination of frames that can be displayed. You must find a balance with which you are comfortable.

When you are navigating through a framed site and finally discover some content you would like to bookmark, you should bookmark only the frame, not its outer frameset. In Netscape, this can be done by right-clicking on the frame, choosing "Open Frame in New Window," and then bookmarking the page from the new window that pops up.

The advantage of this technique is that it works. The disadvantage is that when you use the bookmark to return to the content, you will see the content outside of its framed context (just as you saw it when you opened the frame in a new window). As you design individual frames for your framed site, you should exert an effort to make sure that each frame looks good not only in its framed context, but also stand-alone in its own window.

How can I target two frames with one hyperlink?

One way to accomplish this has already been discussed in lesson two: If the two frames have the same parent frame, then they can both be updated by updating the parent. Review lessons one and two for more details.

If the two frames do not have the same parent, the best course of action is to write Javascript that monitors and manages multiple frame updates. Unfortunately, the use of Javascript is beyond the scope of this tutorial, but good information about integrating Netscape frames and Javascript can be found in the March 1996 issue of Javaworld.

How can I make a form response appear in a different frame?

Just like regular hyperlinks, forms too can use targets to specify which frame or window should be updated. For example, suppose your document has two frames, one of them called "query_frame" and the other called "response_frame". Suppose further that the form is in the frame called query_frame, but you would like the results of the form, when it is submitted, to be displayed in the frame called "response_frame". All that you have to do is add a target to the form header, like this:

<form action=form_interpreter.cgi target=response_frame method=post> ... </form>

How can I program links to "exit" frames?

There is a reserved frame name called "_top" which serves this purpose well. Use the format

<a href=document_URL target=_top>...</a>
to make your links load documents into the entire browser window.

[ menu ]