--- title: DOMImplementation slug: Web/API/DOMImplementation tags: - API - DOM - Interface - Reference translation_of: Web/API/DOMImplementation ---
{{ ApiRef("DOM") }}
DOMImplementation
接口代表了一个对象,这个对象提供了不依赖于任何document的方法。这个对象可以通过{{domxref("Document.implementation")}}属性获得
这个接口没有特定的属性,并且也没有继承到任何属性。
没有继承的方法
true
。旧浏览器的行为非常不一致true
. Old browsers are very inconsistent in their behavior.Specification | Status | Comment |
---|---|---|
{{SpecName('DOM WHATWG', '#domimplementation', 'DOMImplementation')}} | {{Spec2('DOM WHATWG')}} | Removed the getFeature() method.Added the createHTMLDocument() method.Modified the return type of createDocument() from {{domxref("Document")}} to {{domxref("XMLDocument")}}. |
{{SpecName('DOM3 Core', 'core.html#ID-102161490', 'DOMImplementation')}} | {{Spec2('DOM3 Core')}} | Added the getFeature() method (never implemented by any user agent). |
{{SpecName('DOM2 Core', 'core.html#ID-102161490', 'DOMImplementation')}} | {{Spec2('DOM2 Core')}} | Added the createDocument() and createDocumentType() methods. |
{{SpecName('DOM1', 'level-one-core.html#ID-102161490', 'DOMImplementation')}} | {{Spec2('DOM1')}} | Initial definition. |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 | {{CompatGeckoDesktop("1.0")}} | 6.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
createHTMLDocument() |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("2.0")}} | 9.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
createDocument() |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} | 9.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
hasFeature() |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} [1] | 6.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
createDocumentType() |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} | 9.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
createHTMLDocument() |
{{CompatVersionUnknown}} | {{CompatGeckoMobile("2.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
createDocument() |
{{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
hasFeature() |
{{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
createDocumentType() |
{{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
[1] Since Gecko 19, hasFeature()
mostly returns true
.