Of course, you don't have to write into the contents of an iframe with JavaScript; chances are you'll want to load other HTML pages. This example shows you how. Once again, we'll have a main page that sets up the iframe and will be virtually identical to Script 5.16. Similarly, there is a page with the initial content of the iframe, like Script 5.17. There are also three other simple HTML pages (not shown) that we load into the iframe with Script 5.19 . Script 5.19. This script loads HTML pages into the content iframe.
To load an iframe with JavaScript:
|