Loading Multiple Frames at Once

It just takes a single link with a target attribute to change the content of a frame; that’s simple HTML. To change the content of multiple frames with one click, you need JavaScript. The HTML files are trivial; all the action takes pace in Script 5.13. Two of the possible states the window can take are shown in Figures 5.11 and 5.12.

Figure 5.11. The page looks like this initially.

Figure 5.12. But when a link is clicked, both frames change.

To load multiple frames at once:

1.
var leftWin = document.getElementById("left").contentWindow.document; ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh 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.