The previous two lessons focused on the
window object — a programmatic representation of the browser window. The browser window typically contains one web page, and thus only one
window object. The
<frameset/> element, however, allows web developers to divide a browser window into two or more smaller window panes.
Each of these panes is itself a browser window, and as such has a full-fledged
window object. In fact, some browsers allow you to move and resize an individual frame with the moving and resizing methods you learned in Lesson 11 (it is highly recommended that you do not use these methods on a frame).
The easiest way to delve into frame scripting is with a demonstration. The first item you'll look at is the frameset page. Its HTML is as follows:
<html> <head> <title>Frameset Page</title> </head> <frameset rows="50%,*"> <frame name="frmTop" src="frame_top.htm" /> <frame name="frmBottom" src="frame_bottom.htm" /> </frameset> </html>
This is a simple frameset page: It divides the page into upper and lower regions. The frame on top, named
frmTop, loads the
frame_top.htm page into it, and the bottom frame,
frame_bottom.htm. Make note of each frame's name, as they are ...