Node.isSupported() - Web APIs 编辑
Obsolete
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.
The Node.isSupported()
returns a Boolean
flag containing the result of a test whether the DOM implementation implements a specific feature and this feature is supported by the specific node.
Syntax
boolValue = element.isSupported(feature, version)
Parameters
- feature
- Is a
DOMString
containing the name of the feature to test. This is the same name which can be passed to the methodhasFeature
on DOMImplementation. Possible values defined within the core DOM specification are listed on the DOM Level 2 Conformance Section. - version
- Is a
DOMString
containing the version number of the feature to test. In DOM Level 2, version 1, this is the string2.0
. If the version is not specified, supporting any version of the feature will cause the method to return true.
Example
<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>
Specifications
Specification | Status | Comment |
---|---|---|
Document Object Model (DOM) Level 3 Core Specification The definition of 'Node.isSupported()' in that specification. | Obsolete | No change from Document Object Model (DOM) Level 2 Core Specification. |
Document Object Model (DOM) Level 2 Core Specification The definition of 'Node.isSupported()' in that specification. | Obsolete | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
- The
Node
interface it belongs to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论