Frames

If you're already familiar with frames—what they are and how they are used to build web pages—and don't need a review of the basics, you can skip to the section "Frames and JavaScript" on page 172 to learn how the language works with them.

Frame Basics

A web page with frames is actually a set of HTML pages displayed simultaneously. If a page has two frames, it displays two HTML pages, one for each frame. In addition to the HTML pages that provide the content in the frames, another page describes how to display these HTML pages. Figure 10-2 shows the HTML for a simple web page with frames. Figure 10-3 shows what the resulting page looks like in a browser.

Figure 10-2. Code for a simple web page with frames

The code in Figure 10-2 consists of ...

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.