DOMImplementation

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

DOMImplementation 接口代表了一个对象,这个对象提供了不依赖于任何 document 的方法。这个对象可以通过Document.implementation属性获得

属性

这个接口没有特定的属性,并且也没有继承到任何属性。

方法

没有继承的方法。

DOMImplementation.createDocument()

创建并返回一个 XMLDocument对象。

DOMImplementation.createDocumentType()

创建并返回一个 DocumentType对象。

DOMImplementation.createHTMLDocument()

创建并返回一个 Document对象。

DOMImplementation.hasFeature()

返回一个是否支持所给定特性的Boolean值。这个方法是不可靠的,仅用于兼容性目的:除了 SVG 相关的查询,它总是返回 true。旧浏览器的行为非常不一致

规范

Specification
DOM
# interface-domimplementation

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
DOMImplementation
createDocument
createDocumentType
createHTMLDocument
hasFeature
Deprecated

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Deprecated. Not for use in new websites.
See implementation notes.

参见