Forcing a Site into a Frame
If you have a large site, with numerous pages that you want inside a frame, the method described on the preceding page can easily become unwieldy. Here’s a method that works better for larger sites. Script 5.5 shows the frameset, which also calls the JavaScript, shown in Script 5.6 (detailed below). Figure 5.6 shows our page by itself, and Figure 5.7 shows how we intended our site to look. Not shown is the simple HTML page that makes up the left-hand navigation bar in Figure 5.7, or the equally simple HTML pages that make up the content frames. The latter call the JavaScript (just in case they are loaded directly), in the same way as Script 5.5.
Figure 5.6. Here’s our page outside the frame.
Figure 5.7. But here’s ...
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.