过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Node.isSupported() 返回 布尔 flag containing the result of a test whether the DOM implementation implements a specific feature and this feature is supported by the specific node.

句法

boolValue = element.isSupported(feature, version)
					

参数

feature
DOMString containing the name of the feature to test. This is the same name which can be passed to the method hasFeature on DOMImplementation . Possible values defined within the core DOM specification are listed on the DOM Level 2 Conformance Section .
version
DOMString containing the version number of the feature to test. In DOM Level 2, version 1, this is the string 2.0 . If the version is not specified, supporting any version of the feature will cause the method to return true.

范例

<div id="doc">
</div>
<script>
 // Get an element and check to see if its supports the DOM2 HTML Module.
 var main = document.getElementById('doc');
 var output = main.isSupported('HTML', '2.0');
</script>
					

规范

规范 状态 注释
DOM (文档对象模型) 3 级核心规范
The definition of 'Node.isSupported()' in that specification.
过时 无变化自 DOM (文档对象模型) 级别 2 核心规范 .
DOM (文档对象模型) 级别 2 核心规范
The definition of 'Node.isSupported()' in that specification.
过时 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
isSupported Chrome No Edge No Firefox 1 — 22 IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android 4 — 22 Opera Android ? Safari iOS ? Samsung Internet Android No

图例

不支持

不支持

兼容性未知 ?

兼容性未知

另请参阅

元数据

  • 最后修改: