This article is In Progress.
Inserts an object into the HTML page.
The following example uses the script element to define event handlers on the object element.
<SCRIPT FOR=oObject EVENT=eEvent> : </SCRIPT> <OBJECT ID=oObject CLASSID="xyz.abc"> </OBJECT>
The following example illustrates that when an object fails to instantiate for any reason, the HTML inside the object element is rendered. This provides a convenient way to inform the user that the object failed to load.
<OBJECT CLASSID="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> <SPAN STYLE="color:red">ActiveX control failed to load! -- Please check browser security settings.</SPAN> </OBJECT>
An object element can be a child of the head or the body element of a document.
Possible return values (those generated by Dynamic HTML (DHTML) Object Model properties) on the object element depend on the implementation of the object. For example, the readyState property returns null or error if the object does not implement a readyState property. DHTML Object Model properties available for an object depend on the content of the object. For information about supported properties, see the documentation for the individual object.
Events are sent directly to the object element. If the event is returned by the embedded object, it bubbles accordingly. If the event is not returned, it does not bubble.
Note You can use the object property for the object element to reconcile DHTML Object Model members that are duplicated by the object element's implementation and by DHTML. For instance, if the object implements an item method and DHTML implements an item method, use
document.all.objectID.object.item() to access the one defined for the object.
Windows Internet Explorer 9. In IE9 Standards mode, the object element is allowed to load content from other domains. In IE8 Standards mode, however, this is not allowed.
Windows Internet Explorer 8 and later. IE8 mode enables several enhancements to the object element that are not available when pages are displayed in earlier document modes.
- Images are supported as native object types.
- The values of the codeBase and data attributes depend on the current document compatibility mode.
- Object fallback is supported when an object fails to load for communication or cross-domain security failures.
- The title attribute is preferred over the alt attribute when specified as a pop-up tooltip.
- When the value of the data attribute specifies the data URI protocol, the value is not passed to Microsoft ActiveX controls upon instantiation. This preserves compatibility with older ActiveX controls that do not support the data URI protocol.
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.5
- HTML 4.01 Specification, Section 13.3
|HTML 5.1||W3C Working Draft|
|HTML 5||W3C Recommendation|
|HTML 4.01||W3C Recommendation|
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]