Insert a text file into a pageTag(s): Language Language


<object width="300" height="300" type="text/plain" data="message.txt" border="0" >
</object>
To turn off the scrollbar :
<object width="910" height="340" type="text/plain" data="message.txt" border="0"
   style="overflow: hidden;">
</object>
To insert another HTML page, you simply change the type :
<object width="300" height="300" type="text/html" data="js-0100.html" border="1" >
</object>
Here how it looks :

NOTE : You can achieve the same thing with the tag IFRAME but the OBJECT tag is preferred since OBJECT is part the HTML 4 Strict specification and IFRAME is not. However, IFRAME can be a target (for another HREF) but OBJECT can't.

Also the BORDER parameter is not supposed to work with the OBJECT tag (but some browsers accept it). The best practice is to use a style to turn on or off the border (ex. style="border: none;").

See also this HowTo : Include a file into a page (Ajax style).

See also this HowTo : Include an external JS file from another js file or server-side process.


blog comments powered by Disqus