The <object> tag

Importing HTML data into Internet Explorer v4 or later

<object name=UNIQUE_NAME type="text/html" height="450" width="450" border="0"

Substitute UNIQUE_NAME for a text name like "pageOne" and remember to include the quotes.

The height and width elements must be fixed pixels, not percentages or the external page may not be visible. The height and width elements can be altered by Javascript in real time. This has important implications if visitors are browsing at a high resolution. The object tag definition includes scrollbars if the content requires them so you can safely include longer documents.

n.b. this is NOT the same as the <layer> tag used by Navigator to insert HTML.

It is possible to have <object> and <layer> tags in the same document because each browser currently ignores the alternative tag. However, this situation will not necessarily remain when newer browsers are launched. This site uses features of DHTML implemented in IE4 which are not implemented in Navigator 4.5 and so the files are separated anyway. If you choose to use both tags together, consider using Javascript to only insert the correct tag depending on the browser ID using the document.writeln("<object etc command.

Using the <object> tag for other data - applets

Whereas HTML imports through <object> are not supported by Netscape, the use of <object> for applets, media files and other data sources IS supported by Netscape versions 2, 3 and 4. You still use the same <param> tag and the applet URL is entered in the data attribute as above.


This is part of www.codehelp.co.uk Copyright © 1998-2004 Neil Williams
See the file about.html for copying conditions.