object - HTML元素

来源:百度文库 编辑:神马文学网 时间:2024/03/29 16:30:52
定义
在 HTML 页面中插入对象。
Inserts an object into the HTML page.
注释
对象可出现在文档的 head 或 body 内。
如果对象因为任何原因创建失败,浏览器将会显示 OBJECT 元素内的 HTML。这提供了一种便捷方式来通知用户对象载入失败。下面的代码段演示了此技术。
ActiveX 控件装入失败!-- 请检查浏览器的安全设置。
OBJECT 元素可能的返回值 (即由动态 HTML (DHTML) 对象模型属性生成的值) 取决于对象的实现。例如,若对象无法实现 readyState 属性,则 readyState 属性将返回 null 或错误。对象的 DHTML 对象模型属性的可用与否取决于对象的内容。要获得关于所支持的属性的更多信息,请参看单个对象的文档。
事件是直接发送到 OBJECT 元素的。如果事件由嵌入对象返回,那么该事件将接续触发。如果事件不返回,那么将不接续触发。
OBJECT 的事件处理句柄也可以由脚本定义(参看示例)。
注意 如果对象实现的 DHTML 模型成员与 DHTML 定义的成员冲突的话,你可以使用 object 元素的 object 属性来强制使用由对象实现的成员。例如,如果 object 实现了一个 item 方法,而 DHTML 也有一个 item 方法,请使用 document.all.objectID.object.item() 来访问对象自己定义的该方法。
此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。
此元素是一个内嵌元素。
此元素需要关闭标签。
An object can appear in the head or the body of a document.
If 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. The following code fragment illustrates this technique.
ActiveX control failed to load! -- Please check browser security settings.
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.
OBJECT event handlers also can be defined in script (see Example).
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.
This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.
This element is an inline element.
This element requires a closing tag.
示例代码
This example uses script to define event handlers on the object element.
object - HTML元素 HTML 标签 html HTML元素 HTML元素参考手册 a--HTML元素 acronym--HTML元素 address--HTML元素 applet--HTML元素 area--HTML元素 b HTML元素 base HTML元素 basefont HTML元素 bgsound HTML元素 big HTML元素 blockquote HTML元素 body HTML元素 br HTML元素 button HTML元素 center HTML元素 cite HTML元素 code HTML元素 col HTML元素 comment HTML元素 dd HTML元素