Loading New Documents into Iframes
This portion of the Iframes Tutorial provides information on loading new documents into iframes.
JavaScript isn't necessary when you want clicking on a link to load a new document into an iframe since links can specify an iframe in their target attribute. A link set up as follows will load page.html into an iframe with a name ifrm when clicked:
<a href="page.html" target="ifrm">link</a>
Nonetheless, there may be situations were you will need to rely on JavaScript to load new URLs into iframes. The links below load new documents in the iframe that provide information and code for doing so.
You can use your browser's menu commands to view the source code of this document. You can right-click on an iframe to access the source code of the document contained inside it. This tutorial's examples are available for download in a zipped file.
Back to Iframes Tutorial