过时
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)
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
.
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>
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
不支持
兼容性未知
节点
interface it belongs to.
节点
AbortController
AbortSignal
AbstractRange
Attr
ByteString
CDATASection
CSSPrimitiveValue
CSSValue
CSSValueList
CharacterData
ChildNode
注释
CustomEvent
DOMConfiguration
DOMError
DOMErrorHandler
DOMException
DOMImplementation
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMParser
DOMPoint
DOMPointInit
DOMPointReadOnly
DOMRect
DOMString
DOMTimeStamp
DOMTokenList
DOMUserData
Document
DocumentFragment
DocumentType
元素
ElementTraversal
Entity
EntityReference
事件
EventTarget
HTMLCollection
MutationObserver
NodeFilter
NodeIterator
NodeList
NonDocumentTypeChildNode
ProcessingInstruction
PromiseResolver
范围
StaticRange
文本
TextDecoder
TextEncoder
TimeRanges
TreeWalker
TypeInfo
USVString
UserDataHandler
XMLDocument