Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | Netscapte | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Provides methods for performing operations that are DOM implementation independent. | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Creates a new CSSStyleSheet object. | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
Creates an XML document object. | no | 1.0+ | 6.0+ | 8.0+ | 1.3+ | no |
| ||||||
Creates an empty DOCTYPE node for use in an XML document object | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
Creates a blank HTML document that contains properly nested html, head, title, and body tags. | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
Tests a feature to see if the current DOM implementation supports the feature/version. | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
Remarks
This object defines methods for performing operations that are independant
of any particular instance of the DOM. It is equivilant to the Global
object in ECMA-262.This permits a user to, for instance, create new documents, or determine if
the DOM implementation supports some given feature. These are methods that
do not belong in any DOM instance-related objects.
Availability
HTML DOM Level 2 | W3C
Constructor Detail
DOMImplementation DOMImplementation()
Provides methods for performing operations that are DOM implementation independent.
- Visibility
- internal
Method Detail
createCSSStyleSheet(String title, String media) : static CSSStyleSheet
Creates a new CSSStyleSheet object.
| String | title | Title of the CSS stylesheet. |
| String | media | Array of media types that the stylesheet applies to. |
- Availability
HTML DOM Level 2
createDocument(String namespaceURI, String qualifiedName, [DocumentType doctype]) : static Document
Creates an XML document object.
| String | namespaceURI | Namespace URI to use for the root element for the document. |
| String | qualifiedName | Name to use for the root element of the document. |
| DocumentType | doctype | DocumentType object to use for this document. (optional) |
-
For examples, see the quirksmode test page:
- Remarks
-
Creates a new document, which can subsequently be used to add new nodes
and other content.
createDocument takes arguments defining what the name of the document (or root) element will be. Additionally it can take an optionalDocumentTypeobject that can be used to define a logical<!DOCTYPE>block for this document. - Throws
- Raises an INVALID_CHARACTER_ERR error if the specified target contains illegal characers.
- Raises a NAMESPACE_ERR error if qualifiedName is incorrectly formed, has a namespace prefix or is set to xml when the namespaceURI is not "http://www.w3.org/XML/1998/namespace".
- Raises a WRONG_DOCUMENT_ERR error if the supplied doctype has already been used by a different document.
- See Also
DOMImplementation.createDocumentType | DOMImplementation.createHTMLDocument
- Availability
HTML DOM Level 2 | W3C
createDocumentType(String qualifiedName, String publicId, String systemId) : static DocumentType
Creates an empty DOCTYPE node for use in an XML document object
| String | qualifiedName | Qualified name for the document. |
| String | publicId | Unique public id for the external subset. |
| String | systemId | System id for the external subset. |
- Remarks
- Creates a new, blank, document type object, representing what would normally be serialized in XML as the DOCTYPE element so that you can declare entities and notations that are not a part of the content of the document.
- Throws
- Raises INVALID_CHARACTER_ERR error if qualifiedName contains illegal characers.
- Raises NAMESPACE_ERR error if qualifiedName is malformed.
- Availability
HTML DOM Level 2 | W3C
createHTMLDocument(Object title) : HTMLDocument
Creates a blank HTML document that contains properly nested html, head, title, and body tags.
| Object | title | Title of the document to be created. |
-
For examples, see the quirksmode test page:
- See Also
- Availability
HTML DOM Level 2
hasFeature(String feature, [String version]) : Boolean
Tests a feature to see if the current DOM implementation supports the feature/version.
| String | feature | Name of the feature to be tested to see if it is supported. |
| String | version | Version number of the feature to be tested to see if it is supported. (optional) |
-
Using hasFeature
if (document.implementation.hasFeature("DOM", "2.0")) { // Magic happens here } else { // Exit out... } - Remarks
- Use this method to test if the current DOM implementation supports a required feature of your software.
- See Also
- Availability
HTML DOM Level 2 | W3C
