Jump to Real's How-to Main page

Insert a text file into a page

<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 related HowTo


If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]