Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

我們的志工尚未將此文章翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!

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 method hasFeature 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 string 2.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
DOM
The definition of 'Node' in that specification.
Living Standard Removed from the specification.
Document Object Model (DOM) Level 3 Core Specification
The definition of 'Node.isSupported()' in that specification.
Recommendation 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.
Recommendation Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ?

1.0 (1.7 or earlier)

19 (19) (partial)[1]

22 (22)Not supported

? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ?

1.0 (1)

19.0 (19) (partial)[1]

22.0 (22)Not supported

? ? ?

[1] This method will always return true (bug 801425)

See also

  • The Node interface it belongs to.

文件標籤與貢獻者

 最近更新: jwhitlock,