HTML and CSS Reference
In-Depth Information
EXPLANATION ( CONTINUED )
2
This is the URL to the first frame, topframe.html , which will be at the top of the
window.
3
This is the URL to the second frame, main.html , which will be in the middle of the
window.
4
This is the URL to the third frame, bottomframe.html , which will be at the bottom
of the window.
Figure 10.26 Three horizontal frames created in Example 10.15.
The frame Object. HTML frames in JavaScript are represented as an array of frame
objects. The frames[] array is a property of the window object and is referenced with the
window's parent property. Each element of the array represents a frame in the order in
which it appears in the document; thus, window.parent.frames[0] would reference the
first frame defined in a frameset (see Figure 10.27). If you name the frame, then you can
reference the frame element by its name. If the frame is named leftframe , it can be refer-
enced as window.parent.leftframe.
parent
Window
object
frames[0]
frames[1]
frames[2]
Figure 10.27 The JavaScript hierarchy.
 
Search WWH ::




Custom Search