Appendix E: ECMAScript
Language Binding
This appendix contains the complete ECMAScript [ECMAScript] binding for the Level
3 Document Object Model Core definitions.
E.1:
ECMAScript Binding Extension
This section defines the DOMImplementationRegistry
object, discussed in Bootstrapping, for ECMAScript.
- Object DOMImplementationRegistry
-
- The DOMImplementationRegistry object is a global variable
which has the following methods:
-
- getDOMImplementation(features)
- This method returns the first registered
DOMImplementation object that has the desired features, or
null if none is found.
The features parameter is of type String.
- sources
- This property is of type Array. It contains the
DOMImplementationSource objects that are registered.
E.2: Other Core
interfaces
- Prototype Object DOMException
-
- The DOMException class has the following constants:
-
- DOMException.INDEX_SIZE_ERR
- This constant is of type Number and its value is
1.
- DOMException.DOMSTRING_SIZE_ERR
- This constant is of type Number and its value is
2.
- DOMException.HIERARCHY_REQUEST_ERR
- This constant is of type Number and its value is
3.
- DOMException.WRONG_DOCUMENT_ERR
- This constant is of type Number and its value is
4.
- DOMException.INVALID_CHARACTER_ERR
- This constant is of type Number and its value is
5.
- DOMException.NO_DATA_ALLOWED_ERR
- This constant is of type Number and its value is
6.
- DOMException.NO_MODIFICATION_ALLOWED_ERR
- This constant is of type Number and its value is
7.
- DOMException.NOT_FOUND_ERR
- This constant is of type Number and its value is
8.
- DOMException.NOT_SUPPORTED_ERR
- This constant is of type Number and its value is
9.
- DOMException.INUSE_ATTRIBUTE_ERR
- This constant is of type Number and its value is
10.
- DOMException.INVALID_STATE_ERR
- This constant is of type Number and its value is
11.
- DOMException.SYNTAX_ERR
- This constant is of type Number and its value is
12.
- DOMException.INVALID_MODIFICATION_ERR
- This constant is of type Number and its value is
13.
- DOMException.NAMESPACE_ERR
- This constant is of type Number and its value is
14.
- DOMException.INVALID_ACCESS_ERR
- This constant is of type Number and its value is
15.
- Object DOMException
-
- The DOMException object has the following
properties:
-
- code
- This property is of type Number.
- Object DOMImplementationSource
- This is an ECMAScript function reference. This method returns a
DOMImplementation object. The parameter is of type
String.
- Object DOMImplementation
-
- The DOMImplementation object has the following
methods:
-
- hasFeature(feature, version)
- This method returns a Boolean.
The feature parameter is of type String.
The version parameter is of type String.
- createDocumentType(qualifiedName, publicId,
systemId)
- This method returns a DocumentType object.
The qualifiedName parameter is of type String.
The publicId parameter is of type String.
The systemId parameter is of type String.
This method can raise a DOMException object.
- createDocument(namespaceURI, qualifiedName,
doctype)
- This method returns a Document object.
The namespaceURI parameter is of type String.
The qualifiedName parameter is of type String.
The doctype parameter is a DocumentType object.
This method can raise a DOMException object.
- getInterface(feature)
- This method returns a DOMImplementation object.
The feature parameter is of type String.
- Object DocumentFragment
-
- DocumentFragment has the all the properties and methods
of the Node object.
- Object Document
-
- Document has the all the properties and methods of the
Node object as well as the properties and methods defined
below.
- The Document object has the following properties:
-
- doctype
- This read-only property is a DocumentType object.
- implementation
- This read-only property is a DOMImplementation
object.
- documentElement
- This read-only property is a Element object.
- actualEncoding
- This property is of type String.
- encoding
- This property is of type String.
- standalone
- This property is of type Boolean.
- strictErrorChecking
- This property is of type Boolean.
- version
- This property is of type String.
- The Document object has the following methods:
-
- createElement(tagName)
- This method returns a Element object.
The tagName parameter is of type String.
This method can raise a DOMException object.
- createDocumentFragment()
- This method returns a DocumentFragment object.
- createTextNode(data)
- This method returns a Text object.
The data parameter is of type String.
- createComment(data)
- This method returns a Comment object.
The data parameter is of type String.
- createCDATASection(data)
- This method returns a CDATASection object.
The data parameter is of type String.
This method can raise a DOMException object.
- createProcessingInstruction(target, data)
- This method returns a ProcessingInstruction
object.
The target parameter is of type String.
The data parameter is of type String.
This method can raise a DOMException object.
- createAttribute(name)
- This method returns a Attr object.
The name parameter is of type String.
This method can raise a DOMException object.
- createEntityReference(name)
- This method returns a EntityReference object.
The name parameter is of type String.
This method can raise a DOMException object.
- getElementsByTagName(tagname)
- This method returns a NodeList object.
The tagname parameter is of type String.
- importNode(importedNode, deep)
- This method returns a Node object.
The importedNode parameter is a Node object.
The deep parameter is of type Boolean.
This method can raise a DOMException object.
- createElementNS(namespaceURI, qualifiedName)
- This method returns a Element object.
The namespaceURI parameter is of type String.
The qualifiedName parameter is of type String.
This method can raise a DOMException object.
- createAttributeNS(namespaceURI, qualifiedName)
- This method returns a Attr object.
The namespaceURI parameter is of type String.
The qualifiedName parameter is of type String.
This method can raise a DOMException object.
- getElementsByTagNameNS(namespaceURI, localName)
- This method returns a NodeList object.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
- getElementById(elementId)
- This method returns a Element object.
The elementId parameter is of type String.
- adoptNode(source)
- This method returns a Node object.
The source parameter is a Node object.
This method can raise a DOMException object.
- setBaseURI(baseURI)
- This method has no return value.
The baseURI parameter is of type String.
This method can raise a DOMException object.
- Prototype Object Node
-
- The Node class has the following constants:
-
- Node.ELEMENT_NODE
- This constant is of type Number and its value is
1.
- Node.ATTRIBUTE_NODE
- This constant is of type Number and its value is
2.
- Node.TEXT_NODE
- This constant is of type Number and its value is
3.
- Node.CDATA_SECTION_NODE
- This constant is of type Number and its value is
4.
- Node.ENTITY_REFERENCE_NODE
- This constant is of type Number and its value is
5.
- Node.ENTITY_NODE
- This constant is of type Number and its value is
6.
- Node.PROCESSING_INSTRUCTION_NODE
- This constant is of type Number and its value is
7.
- Node.COMMENT_NODE
- This constant is of type Number and its value is
8.
- Node.DOCUMENT_NODE
- This constant is of type Number and its value is
9.
- Node.DOCUMENT_TYPE_NODE
- This constant is of type Number and its value is
10.
- Node.DOCUMENT_FRAGMENT_NODE
- This constant is of type Number and its value is
11.
- Node.NOTATION_NODE
- This constant is of type Number and its value is
12.
- Node.TREE_POSITION_PRECEDING
- This constant is of type Number and its value is
0x01.
- Node.TREE_POSITION_FOLLOWING
- This constant is of type Number and its value is
0x02.
- Node.TREE_POSITION_ANCESTOR
- This constant is of type Number and its value is
0x04.
- Node.TREE_POSITION_DESCENDANT
- This constant is of type Number and its value is
0x08.
- Node.TREE_POSITION_SAME
- This constant is of type Number and its value is
0x10.
- Node.TREE_POSITION_EXACT_SAME
- This constant is of type Number and its value is
0x20.
- Node.TREE_POSITION_DISCONNECTED
- This constant is of type Number and its value is
0x00.
- Object Node
-
- The Node object has the following properties:
-
- nodeName
- This read-only property is of type String.
- nodeValue
- This property is of type String, can raise a
DOMException object on setting and can raise a
DOMException object on retrieval.
- nodeType
- This read-only property is of type Number.
- parentNode
- This read-only property is a Node object.
- childNodes
- This read-only property is a NodeList object.
- firstChild
- This read-only property is a Node object.
- lastChild
- This read-only property is a Node object.
- previousSibling
- This read-only property is a Node object.
- nextSibling
- This read-only property is a Node object.
- attributes
- This read-only property is a NamedNodeMap object.
- ownerDocument
- This read-only property is a Document object.
- namespaceURI
- This read-only property is of type String.
- prefix
- This property is of type String and can raise a
DOMException object on setting.
- localName
- This read-only property is of type String.
- baseURI
- This read-only property is of type String.
- textContent
- This property is of type String, can raise a
DOMException object on setting and can raise a
DOMException object on retrieval.
- The Node object has the following methods:
-
- insertBefore(newChild, refChild)
- This method returns a Node object.
The newChild parameter is a Node object.
The refChild parameter is a Node object.
This method can raise a DOMException object.
- replaceChild(newChild, oldChild)
- This method returns a Node object.
The newChild parameter is a Node object.
The oldChild parameter is a Node object.
This method can raise a DOMException object.
- removeChild(oldChild)
- This method returns a Node object.
The oldChild parameter is a Node object.
This method can raise a DOMException object.
- appendChild(newChild)
- This method returns a Node object.
The newChild parameter is a Node object.
This method can raise a DOMException object.
- hasChildNodes()
- This method returns a Boolean.
- cloneNode(deep)
- This method returns a Node object.
The deep parameter is of type Boolean.
- normalize()
- This method has no return value.
- isSupported(feature, version)
- This method returns a Boolean.
The feature parameter is of type String.
The version parameter is of type String.
- hasAttributes()
- This method returns a Boolean.
- compareTreePosition(other)
- This method returns a Number.
The other parameter is a Node object.
This method can raise a DOMException object.
- isSameNode(other)
- This method returns a Boolean.
The other parameter is a Node object.
- lookupNamespacePrefix(namespaceURI)
- This method returns a String.
The namespaceURI parameter is of type String.
- lookupNamespaceURI(prefix)
- This method returns a String.
The prefix parameter is of type String.
- normalizeNS()
- This method has no return value.
- isEqualNode(arg, deep)
- This method returns a Boolean.
The arg parameter is a Node object.
The deep parameter is of type Boolean.
- getInterface(feature)
- This method returns a Node object.
The feature parameter is of type String.
- setUserData(key, data, handler)
- This method returns a Object object.
The key parameter is of type String.
The data parameter is a Object object.
The handler parameter is a UserDataHandler
object.
- getUserData(key)
- This method returns a Object object.
The key parameter is of type String.
- Object NodeList
-
- The NodeList object has the following properties:
-
- length
- This read-only property is of type Number.
- The NodeList object has the following methods:
-
- item(index)
- This method returns a Node object.
The index parameter is of type Number.
Note: This object can also be dereferenced using square
bracket notation (e.g. obj[1]). Dereferencing with an integer
index is equivalent to invoking the item method with
that index.
- Object NamedNodeMap
-
- The NamedNodeMap object has the following
properties:
-
- length
- This read-only property is of type Number.
- The NamedNodeMap object has the following methods:
-
- getNamedItem(name)
- This method returns a Node object.
The name parameter is of type String.
- setNamedItem(arg)
- This method returns a Node object.
The arg parameter is a Node object.
This method can raise a DOMException object.
- removeNamedItem(name)
- This method returns a Node object.
The name parameter is of type String.
This method can raise a DOMException object.
- item(index)
- This method returns a Node object.
The index parameter is of type Number.
Note: This object can also be dereferenced using square
bracket notation (e.g. obj[1]). Dereferencing with an integer
index is equivalent to invoking the item method with
that index.
- getNamedItemNS(namespaceURI, localName)
- This method returns a Node object.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
- setNamedItemNS(arg)
- This method returns a Node object.
The arg parameter is a Node object.
This method can raise a DOMException object.
- removeNamedItemNS(namespaceURI, localName)
- This method returns a Node object.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
This method can raise a DOMException object.
- Object CharacterData
-
- CharacterData has the all the properties and methods of
the Node object as well as the properties and methods
defined below.
- The CharacterData object has the following
properties:
-
- data
- This property is of type String, can raise a
DOMException object on setting and can raise a
DOMException object on retrieval.
- length
- This read-only property is of type Number.
- The CharacterData object has the following methods:
-
- substringData(offset, count)
- This method returns a String.
The offset parameter is of type Number.
The count parameter is of type Number.
This method can raise a DOMException object.
- appendData(arg)
- This method has no return value.
The arg parameter is of type String.
This method can raise a DOMException object.
- insertData(offset, arg)
- This method has no return value.
The offset parameter is of type Number.
The arg parameter is of type String.
This method can raise a DOMException object.
- deleteData(offset, count)
- This method has no return value.
The offset parameter is of type Number.
The count parameter is of type Number.
This method can raise a DOMException object.
- replaceData(offset, count, arg)
- This method has no return value.
The offset parameter is of type Number.
The count parameter is of type Number.
The arg parameter is of type String.
This method can raise a DOMException object.
- Object Attr
-
- Attr has the all the properties and methods of the
Node object as well as the properties and methods defined
below.
- The Attr object has the following properties:
-
- name
- This read-only property is of type String.
- specified
- This read-only property is of type Boolean.
- value
- This property is of type String and can raise a
DOMException object on setting.
- ownerElement
- This read-only property is a Element object.
- Object Element
-
- Element has the all the properties and methods of the
Node object as well as the properties and methods defined
below.
- The Element object has the following properties:
-
- tagName
- This read-only property is of type String.
- The Element object has the following methods:
-
- getAttribute(name)
- This method returns a String.
The name parameter is of type String.
- setAttribute(name, value)
- This method has no return value.
The name parameter is of type String.
The value parameter is of type String.
This method can raise a DOMException object.
- removeAttribute(name)
- This method has no return value.
The name parameter is of type String.
This method can raise a DOMException object.
- getAttributeNode(name)
- This method returns a Attr object.
The name parameter is of type String.
- setAttributeNode(newAttr)
- This method returns a Attr object.
The newAttr parameter is a Attr object.
This method can raise a DOMException object.
- removeAttributeNode(oldAttr)
- This method returns a Attr object.
The oldAttr parameter is a Attr object.
This method can raise a DOMException object.
- getElementsByTagName(name)
- This method returns a NodeList object.
The name parameter is of type String.
- getAttributeNS(namespaceURI, localName)
- This method returns a String.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
- setAttributeNS(namespaceURI, qualifiedName, value)
- This method has no return value.
The namespaceURI parameter is of type String.
The qualifiedName parameter is of type String.
The value parameter is of type String.
This method can raise a DOMException object.
- removeAttributeNS(namespaceURI, localName)
- This method has no return value.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
This method can raise a DOMException object.
- getAttributeNodeNS(namespaceURI, localName)
- This method returns a Attr object.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
- setAttributeNodeNS(newAttr)
- This method returns a Attr object.
The newAttr parameter is a Attr object.
This method can raise a DOMException object.
- getElementsByTagNameNS(namespaceURI, localName)
- This method returns a NodeList object.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
- hasAttribute(name)
- This method returns a Boolean.
The name parameter is of type String.
- hasAttributeNS(namespaceURI, localName)
- This method returns a Boolean.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
- Object Text
-
- Text has the all the properties and methods of the
CharacterData object as well as the properties and methods
defined below.
- The Text object has the following properties:
-
- isWhitespaceInElementContent
- This read-only property is of type Boolean.
- wholeText
- This read-only property is of type String.
- The Text object has the following methods:
-
- splitText(offset)
- This method returns a Text object.
The offset parameter is of type Number.
This method can raise a DOMException object.
- replaceWholeText(content)
- This method returns a Text object.
The content parameter is of type String.
This method can raise a DOMException object.
- Object Comment
-
- Comment has the all the properties and methods of the
CharacterData object.
- Prototype Object UserDataHandler
-
- The UserDataHandler class has the following
constants:
-
- UserDataHandler.CLONED
- This constant is of type Number and its value is
1.
- UserDataHandler.IMPORTED
- This constant is of type Number and its value is
2.
- UserDataHandler.DELETED
- This constant is of type Number and its value is
3.
- Object UserDataHandler
-
- The UserDataHandler object has the following
methods:
-
- handle(operation, key, data, src, dst)
- This method has no return value.
The operation parameter is of type Number.
The key parameter is of type String.
The data parameter is a Object object.
The src parameter is a Node object.
The dst parameter is a Node object.
- Prototype Object DOMError
-
- The DOMError class has the following constants:
-
- DOMError.SEVERITY_WARNING
- This constant is of type Number and its value is
0.
- DOMError.SEVERITY_ERROR
- This constant is of type Number and its value is
1.
- DOMError.SEVERITY_FATAL_ERROR
- This constant is of type Number and its value is
2.
- Object DOMError
-
- The DOMError object has the following properties:
-
- severity
- This read-only property is of type Number.
- message
- This read-only property is of type String.
- exception
- This read-only property is a Object object.
- location
- This read-only property is a DOMLocator object.
- Object DOMErrorHandler
-
- The DOMErrorHandler object has the following
methods:
-
- handleError(error)
- This method returns a Boolean.
The error parameter is a DOMError object.
- Object DOMLocator
-
- The DOMLocator object has the following properties:
-
- lineNumber
- This read-only property is of type Number.
- columnNumber
- This read-only property is of type Number.
- offset
- This read-only property is of type Number.
- errorNode
- This read-only property is a Node object.
- uri
- This read-only property is of type String.
- Object CDATASection
-
- CDATASection has the all the properties and methods of
the Text object.
- Object DocumentType
-
- DocumentType has the all the properties and methods of
the Node object as well as the properties and methods
defined below.
- The DocumentType object has the following
properties:
-
- name
- This read-only property is of type String.
- entities
- This read-only property is a NamedNodeMap object.
- notations
- This read-only property is a NamedNodeMap object.
- publicId
- This read-only property is of type String.
- systemId
- This read-only property is of type String.
- internalSubset
- This read-only property is of type String.
- Object Notation
-
- Notation has the all the properties and methods of the
Node object as well as the properties and methods defined
below.
- The Notation object has the following properties:
-
- publicId
- This read-only property is of type String.
- systemId
- This read-only property is of type String.
- Object Entity
-
- Entity has the all the properties and methods of the
Node object as well as the properties and methods defined
below.
- The Entity object has the following properties:
-
- publicId
- This read-only property is of type String.
- systemId
- This read-only property is of type String.
- notationName
- This read-only property is of type String.
- actualEncoding
- This property is of type String.
- encoding
- This property is of type String.
- version
- This property is of type String.
- Object EntityReference
-
- EntityReference has the all the properties and methods
of the Node object.
- Object ProcessingInstruction
-
- ProcessingInstruction has the all the properties and
methods of the Node object as well as the properties and
methods defined below.
- The ProcessingInstruction object has the following
properties:
-
- target
- This read-only property is of type String.
- data
- This property is of type String and can raise a
DOMException object on setting.