Chapter 5: Frames, Frames, and More Frames

Return to Chapter 5


To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Working with Iframes

See it run: Working with Iframes

Script 5.16

An iframe is an inline frame that is embedded within a regular HTML page instead of needing to be inside of a frameset. This HTML page creates the iframe and calls the external JavaScript.

Script 5.17

This HTML file is the initial page that goes in the iframe.

Script 5.18

This JavaScript calculates the contents of the iframe and writes it into the window.