|
|
a.html | yz.html |
Notice that these files contain links to contents documents x.html, y.html, and z.html. These are just regular HTML documents, viewable even with a frames-incapable browser. We concluded our example in Lesson 1 by laying out three contents documents, x.html, y.html, and z.html, into frames, as shown in Fig. 2.
Fig. 2 -- Three separate documents displayed in single window using frames.
We will program the hyperlinks in each of the frames to update the relative positions of documents Y and Z, so that when hyperlink "YZ" is selected, the browser window will appear as in Fig. 2, and when hyperlink "ZY" is selected, the browser window will appear as in Fig. 3.
Fig. 3 -- Previous figure with frames Y and Z switched.
This means that the hyperlinks in document X will update other frames and hyperlinks in documents Y and Z will update their own frames.
Frames, however, present a different scenario. When hyperlinks in framed documents are selected, the browser may update just the frame containing the hyperlink, a different frame, a set of frames, or even the entire window. Thus, when a hyperlink is selected, some or all parts of the browser window may change, depending on parameters specified in the hyperlink.
target
, for this purpose. For each hyperlink, it is
now possible to specify where the new document should be displayed. The
format for a hyperlink with a target is
targetname may be either an explicit name assigned to frames in layout documents, such as the frame name "<a href=
documentURLtarget=
targetname>
Hyperlink Text</a>
bottom
" appearing
in layout document a.html, and an implicit name, which is
determined by the frame's relationship to other frames. Implicit names
are reserved words beginning with an underscore (_). Some of these are
listed below:
_self
- Directs the browser to update the frame containing the selected hyperlink. This is the default target if no target is specified at all.
_parent
- Directs the browser to update the parent frame if the frame containing the hyperlink is a child frame, otherwise has the same effect as
_self
._top
- Directs the browser to update the entire window, regardless of the current frame layout.
You can assign names to frames by including the tag property
"name=
frame_name" in the <frame>
tag, as shown in the second frame definition in a.html. In this
example, the upper row has no name, while the lower row has the name
"bottom". Note that in this example a name is being assigned
not just to a frame, but to a collection of frames, or the frames
containing documents Y and Z. This will make it possible for a hyperlink
to target the entire row for update.
X X
YZ ZY