javascript Node isSupported( )
isSupported( ) | Firefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM 2 |
isSupported("feature", "version") | |
Returns a Boolean true if the current node supports (i.e., conforms to the required specifications of) a stated W3C DOM module and version. While the document.implementation object's hasFeature( ) method performs the same test, it does so on the entire browser application. The isSupported( ) method performs the test on an individual node, allowing you to verify feature support for the current node type. Parameter values for isSupported( ) are the same as for document.implementation.hasFeature( ). |
|
It is up to the browser maker to validate that the DOM implemented in the browser conforms with each module before allowing the browser to return true for the module. That doesn't necessarily mean that the implementation is bug-free or consistent with other implementations. Caveat scriptor. |
|
In theory, you could use this method to verify module support prior to accessing a property or invoking a method, as in the following fragment that assumes myElem is a reference to an element node: if (myElem.isSupported("CSS", "2.0")) { myElem.style.color = "green"; } |
|
In practice, object detection is a better solution because W3C DOM support reporting facilities are not widely implemented yet and are certainly not backward compatible. |
|
Parameters | |
|
|
Returned Value | |
Boolean value: true | false. |
Powered by Linode.