DOMImplementation - Web API 接口参考 编辑
DOMImplementation
接口代表了一个对象,这个对象提供了不依赖于任何document的方法。这个对象可以通过Document.implementation
属性获得
属性
这个接口没有特定的属性,并且也没有继承到任何属性。
方法
没有继承的方法
DOMImplementation.createDocument()
- 创建并返回一个
XMLDocument
对象. DOMImplementation.createDocumentType()
- 创建并返回一个
DocumentType
对象. DOMImplementation.createHTMLDocument()
- 创建并返回一个
Document
对象. DOMImplementation.hasFeature()
- 返回一个是否支持所给定特性的
Boolean
值。这个方法是不可靠的,仅用于兼容性目的:除了SVG相关的查询,它总是返回true
。旧浏览器的行为非常不一致 - Returns a
Boolean
indicating if a given feature is supported or not. This function is unreliable and kept for compatibility purpose alone: except for SVG-related queries, it always returnstrue
. Old browsers are very inconsistent in their behavior.
规范
Specification | Status | Comment |
---|---|---|
DOM DOMImplementation | Living Standard | Removed the getFeature() method.Added the createHTMLDocument() method.Modified the return type of createDocument() from Document to XMLDocument . |
Document Object Model (DOM) Level 3 Core Specification DOMImplementation | Obsolete | Added the getFeature() method (never implemented by any user agent). |
Document Object Model (DOM) Level 2 Core Specification DOMImplementation | Obsolete | Added the createDocument() and createDocumentType() methods. |
Document Object Model (DOM) Level 1 Specification DOMImplementation | Obsolete | Initial definition. |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 | 1.0 (1.7 or earlier) | 6.0 | (Yes) | (Yes) |
createHTMLDocument() | (Yes) | 4.0 (2.0) | 9.0 | (Yes) | (Yes) |
createDocument() | (Yes) | 1.0 (1.7 or earlier) | 9.0 | (Yes) | (Yes) |
hasFeature() | (Yes) | 1.0 (1.7 or earlier) [1] | 6.0 | (Yes) | (Yes) |
createDocumentType() | (Yes) | 1.0 (1.7 or earlier) | 9.0 | (Yes) | (Yes) |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
createHTMLDocument() | (Yes) | 4.0 (2.0) | (Yes) | (Yes) | (Yes) |
createDocument() | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
hasFeature() | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
createDocumentType() | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
[1] Since Gecko 19, hasFeature()
mostly returns true
.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论