27 September, 2000

Appendix E: ECMA Script Language Binding

This appendix contains the complete ECMA Script [ECMAScript] binding for the Level 2 Document Object Model Core definitions.

Note: Exceptions handling is only supported by ECMAScript implementation compliant with the Standard ECMA-262 3rd. Edition ([ECMAScript]).

Class DOMException
The DOMException class has the following constants:
DOMException.INDEX_SIZE_ERR
This constant is of type short and its value is 1.
DOMException.DOMSTRING_SIZE_ERR
This constant is of type short and its value is 2.
DOMException.HIERARCHY_REQUEST_ERR
This constant is of type short and its value is 3.
DOMException.WRONG_DOCUMENT_ERR
This constant is of type short and its value is 4.
DOMException.INVALID_CHARACTER_ERR
This constant is of type short and its value is 5.
DOMException.NO_DATA_ALLOWED_ERR
This constant is of type short and its value is 6.
DOMException.NO_MODIFICATION_ALLOWED_ERR
This constant is of type short and its value is 7.
DOMException.NOT_FOUND_ERR
This constant is of type short and its value is 8.
DOMException.NOT_SUPPORTED_ERR
This constant is of type short and its value is 9.
DOMException.INUSE_ATTRIBUTE_ERR
This constant is of type short and its value is 10.
DOMException.INVALID_STATE_ERR
This constant is of type short and its value is 11.
DOMException.SYNTAX_ERR
This constant is of type short and its value is 12.
DOMException.INVALID_MODIFICATION_ERR
This constant is of type short and its value is 13.
DOMException.NAMESPACE_ERR
This constant is of type short and its value is 14.
DOMException.INVALID_ACCESS_ERR
This constant is of type short and its value is 15.
Exception DOMException
The DOMException object has the following properties:
code
This property is of type unsigned short.
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.
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.
createDocument(namespaceURI, qualifiedName, doctype)
This method returns a Document.
The namespaceURI parameter is of type String.
The qualifiedName parameter is of type String.
The doctype parameter is of type DocumentType.
This method can raise a DOMException.
Object DocumentFragment
DocumentFragment has the all the properties and methods of Node as well as the properties and methods defined below.
Object Document
Document has the all the properties and methods of Node as well as the properties and methods defined below.
The Document object has the following properties:
doctype
This read-only property is of type DocumentType.
implementation
This read-only property is of type DOMImplementation.
documentElement
This read-only property is of type Element.
The Document object has the following methods:
createElement(tagName)
This method returns a Element.
The tagName parameter is of type String.
This method can raise a DOMException.
createDocumentFragment()
This method returns a DocumentFragment.
createTextNode(data)
This method returns a Text.
The data parameter is of type String.
createComment(data)
This method returns a Comment.
The data parameter is of type String.
createCDATASection(data)
This method returns a CDATASection.
The data parameter is of type String.
This method can raise a DOMException.
createProcessingInstruction(target, data)
This method returns a ProcessingInstruction.
The target parameter is of type String.
The data parameter is of type String.
This method can raise a DOMException.
createAttribute(name)
This method returns a Attr.
The name parameter is of type String.
This method can raise a DOMException.
createEntityReference(name)
This method returns a EntityReference.
The name parameter is of type String.
This method can raise a DOMException.
getElementsByTagName(tagname)
This method returns a NodeList.
The tagname parameter is of type String.
importNode(importedNode, deep)
This method returns a Node.
The importedNode parameter is of type Node.
The deep parameter is of type boolean.
This method can raise a DOMException.
createElementNS(namespaceURI, qualifiedName)
This method returns a Element.
The namespaceURI parameter is of type String.
The qualifiedName parameter is of type String.
This method can raise a DOMException.
createAttributeNS(namespaceURI, qualifiedName)
This method returns a Attr.
The namespaceURI parameter is of type String.
The qualifiedName parameter is of type String.
This method can raise a DOMException.
getElementsByTagNameNS(namespaceURI, localName)
This method returns a NodeList.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
getElementById(elementId)
This method returns a Element.
The elementId parameter is of type String.
Class Node
The Node class has the following constants:
Node.ELEMENT_NODE
This constant is of type short and its value is 1.
Node.ATTRIBUTE_NODE
This constant is of type short and its value is 2.
Node.TEXT_NODE
This constant is of type short and its value is 3.
Node.CDATA_SECTION_NODE
This constant is of type short and its value is 4.
Node.ENTITY_REFERENCE_NODE
This constant is of type short and its value is 5.
Node.ENTITY_NODE
This constant is of type short and its value is 6.
Node.PROCESSING_INSTRUCTION_NODE
This constant is of type short and its value is 7.
Node.COMMENT_NODE
This constant is of type short and its value is 8.
Node.DOCUMENT_NODE
This constant is of type short and its value is 9.
Node.DOCUMENT_TYPE_NODE
This constant is of type short and its value is 10.
Node.DOCUMENT_FRAGMENT_NODE
This constant is of type short and its value is 11.
Node.NOTATION_NODE
This constant is of type short and its value is 12.
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 on setting and can raise a DOMException on retrieval.
nodeType
This read-only property is of type short.
parentNode
This read-only property is of type Node.
childNodes
This read-only property is of type NodeList.
firstChild
This read-only property is of type Node.
lastChild
This read-only property is of type Node.
previousSibling
This read-only property is of type Node.
nextSibling
This read-only property is of type Node.
attributes
This read-only property is of type NamedNodeMap.
ownerDocument
This read-only property is of type Document.
namespaceURI
This read-only property is of type String.
prefix
This property is of type String and can raise a DOMException on setting.
localName
This read-only property is of type String.
The Node object has the following methods:
insertBefore(newChild, refChild)
This method returns a Node.
The newChild parameter is of type Node.
The refChild parameter is of type Node.
This method can raise a DOMException.
replaceChild(newChild, oldChild)
This method returns a Node.
The newChild parameter is of type Node.
The oldChild parameter is of type Node.
This method can raise a DOMException.
removeChild(oldChild)
This method returns a Node.
The oldChild parameter is of type Node.
This method can raise a DOMException.
appendChild(newChild)
This method returns a Node.
The newChild parameter is of type Node.
This method can raise a DOMException.
hasChildNodes()
This method returns a boolean.
cloneNode(deep)
This method returns a Node.
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.
Object NodeList
The NodeList object has the following properties:
length
This read-only property is of type int.
The NodeList object has the following methods:
item(index)
This method returns a Node.
The index parameter is of type int.
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 int.
The NamedNodeMap object has the following methods:
getNamedItem(name)
This method returns a Node.
The name parameter is of type String.
setNamedItem(arg)
This method returns a Node.
The arg parameter is of type Node.
This method can raise a DOMException.
removeNamedItem(name)
This method returns a Node.
The name parameter is of type String.
This method can raise a DOMException.
item(index)
This method returns a Node.
The index parameter is of type int.
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.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
setNamedItemNS(arg)
This method returns a Node.
The arg parameter is of type Node.
This method can raise a DOMException.
removeNamedItemNS(namespaceURI, localName)
This method returns a Node.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
This method can raise a DOMException.
Object CharacterData
CharacterData has the all the properties and methods of Node 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 on setting and can raise a DOMException on retrieval.
length
This read-only property is of type int.
The CharacterData object has the following methods:
substringData(offset, count)
This method returns a String.
The offset parameter is of type int.
The count parameter is of type int.
This method can raise a DOMException.
appendData(arg)
This method has no return value.
The arg parameter is of type String.
This method can raise a DOMException.
insertData(offset, arg)
This method has no return value.
The offset parameter is of type int.
The arg parameter is of type String.
This method can raise a DOMException.
deleteData(offset, count)
This method has no return value.
The offset parameter is of type int.
The count parameter is of type int.
This method can raise a DOMException.
replaceData(offset, count, arg)
This method has no return value.
The offset parameter is of type int.
The count parameter is of type int.
The arg parameter is of type String.
This method can raise a DOMException.
Object Attr
Attr has the all the properties and methods of Node 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 on setting.
ownerElement
This read-only property is of type Element.
Object Element
Element has the all the properties and methods of Node 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.
removeAttribute(name)
This method has no return value.
The name parameter is of type String.
This method can raise a DOMException.
getAttributeNode(name)
This method returns a Attr.
The name parameter is of type String.
setAttributeNode(newAttr)
This method returns a Attr.
The newAttr parameter is of type Attr.
This method can raise a DOMException.
removeAttributeNode(oldAttr)
This method returns a Attr.
The oldAttr parameter is of type Attr.
This method can raise a DOMException.
getElementsByTagName(name)
This method returns a NodeList.
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.
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.
getAttributeNodeNS(namespaceURI, localName)
This method returns a Attr.
The namespaceURI parameter is of type String.
The localName parameter is of type String.
setAttributeNodeNS(newAttr)
This method returns a Attr.
The newAttr parameter is of type Attr.
This method can raise a DOMException.
getElementsByTagNameNS(namespaceURI, localName)
This method returns a NodeList.
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 CharacterData as well as the properties and methods defined below.
The Text object has the following methods:
splitText(offset)
This method returns a Text.
The offset parameter is of type int.
This method can raise a DOMException.
Object Comment
Comment has the all the properties and methods of CharacterData as well as the properties and methods defined below.
Object CDATASection
CDATASection has the all the properties and methods of Text as well as the properties and methods defined below.
Object DocumentType
DocumentType has the all the properties and methods of Node 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 of type NamedNodeMap.
notations
This read-only property is of type NamedNodeMap.
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 Node 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 Node 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.
Object EntityReference
EntityReference has the all the properties and methods of Node as well as the properties and methods defined below.
Object ProcessingInstruction
ProcessingInstruction has the all the properties and methods of Node 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 on setting.