XML DOM hasFeature() method

Definition and usage

The hasFeature() method determines whether the DOM implementation supports a certain feature.

Syntax:

nodeObject.selectNodes(feature, version)
Parameter Description
feature

Feature name, used to determine which support is being tested. Features are case-insensitive.

The following table lists the set of valid feature names supported by the 2nd level DOM standard.

version

Version number, used to determine which support is being tested, or null.

If all versions of the feature are supported, it is an empty string ("").

In the 2nd level DOM standard, the supported version numbers are 1.0 and 2.0.

Return value

If the current implementation fully supports the specified version of the specified feature, the return value is true, otherwise it is false. If the version number is not specified, and the implementation fully supports all versions of the specified feature, the method also returns true.

Description

The W3C DOM standard is modular, and does not require each implementation to implement all modules or features in the standard. This method is used to detect whether a DOM implementation supports the modules defined in the DOM standard.

Note that although Internet Explorer 5 and 5.5 partially support the 1st level DOM standard, before IE 6, there was no implementation that supported this important method.

The following table lists the complete set of module names that can be used as the feature parameter.

Features Description
Core

Implementing the basic interfaces required for Node, Element, Document, Text and all other DOM implementations

Wszystkie realizacje zgodne z standardem DOM muszą obsługiwać ten moduł.

HTML Implementuje interfejsy specyficzne dla HTMLElement, HTMLDocument i innych interfejsów HTML.
XML Implementuje typy węzłów specjalne dla dokumentów XML, takie jak Entity, EntityReference, ProcessingInstruction, Notation i inne.
StyleSheets Implementuje prosty interfejs do opisu zwykłych arkuszy stylów.
CSS Implementuje interfejsy specyficzne dla arkuszy stylów CSS.
CSS2 Implementuje interfejs CSS2Properties.
Zdarzenia Implementuje podstawowy interfejs do obsługi zdarzeń.
Zdarzenia UIEvents Implementuje interfejs do obsługi zdarzeń interfejsu użytkownika.
Zdarzenia MouseEvents Implementuje interfejs do obsługi zdarzeń myszy.
Zdarzenia HTMLEvents Implementuje interfejs do obsługi zdarzeń HTML.
Zdarzenia Mutacji Implementuje interfejs do obsługi zdarzeń zmian dokumentu.
Zakres Implementuje interfejs do operacji na zakresie dokumentu.
Przegląd Implementuje interfejs do zaawansowanego przeglądania dokumentu.
Widoki Implementuje interfejs do obsługi widoku dokumentu.

Zobacz

Node.isSupported()