Iframes, or inline frames, are a very convenient way to create a section within a page that can be changed independently of the rest of the page. As the name already suggests, iframes are very similar to frames; however, some subtle changes exist. Here is the HTML markup for such an inline frame: <iframe src="/books/3/490/1/html/2/iframe1a.html" name="iframe1a" ></iframe> Note that both a name and an ID are provided for the iframe, since there are two ways to approach the frame:
The former approach requires the location.href property to change the URL within the iframe; the latter approach returns an object that has an src property for that task:
Warning Although iframes offer new capabilities for web applications, they also have their disadvantages. As you will see in Chapter 11, "AJAX (and Related Topics)," bookmarking and letting the back and forward buttons work as expected require some workaroundand these hacks work only when JavaScript is activated. |