New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact
Categories
Other Sections
Sweet Ads
Compatibility
Bookmark online:


FF2 IE5+ Opr7+

Document-in-document script

Author: Dynamic Drive

Description: Want to add the power of SSI to your site, but your web host doesn't support it? Use this script instead! It allows you to include a document inside another easily, simply by specifying the URL of the external document inside the "master" document. just like SSI. How does the script do that? With the help of a not-so-well-known HTML tag- <object>. Put inside its "data" attribute the file name of the external document, and the element downloads and displays it as if it's part of the master document. By including the <object>.tag in multiple pages, a change to the target external document is instantly reflected on ALL of these pages. Ah, the power of DHTML!

Demo: The below example may not look like much, but it is, for one simple reason- it came from an external HTML file, dynamically downloaded and pasted onto this page by the <object> element!


Directions

Step 1: Simply add the following chunk of code wherever you wish to include another document inside the current. Remember to configure the width/height and data attributes to match the specifications of the external document.

Select All