Java Reference
In-Depth Information
Figure 8-4
Figure 8-5
The paths in Figures 8-3 and 8-5 will vary depending upon where the fi les are stored on your computer.
Look at the frameset-defi ning page, starting with ch08_examp1.htm, as shown in the following
snippet:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Chapter 8: Example 1</title>
</head>
<frameset rows=”50%, *” id=”topWindow”>
<frame name=”upperWindow” src=”ch08_examp1_upper.htm” />
<frame name=”lowerWindow” src=”ch08_examp1_lower.htm” />
</frameset>
</html>
The frameset is defi ned with the <frameset /> element. You use two attributes: rows and id . The rows
attribute takes the value “50%,*” meaning that the fi rst frame should take up half of the height of the
window, and the second frame should take up the rest of the room. The id attribute is used to give a
name that you can use to reference the page.
The two child windows are created using <frame /> elements; each of which contains a name attribute
by which the window objects will be known and a src attribute of the page that will be loaded into the
newly created windows.
Let's take a look at the ch08_examp1_upper.htm fi le next. In the <body /> element, you attach the
window_onload() function to the window object's onload event handler. This event handler is called
Search WWH ::




Custom Search