Programming
- Previous Page DOM DocumentType
- Next Page DOM Implementation
XML DOM - DOMException object
Notifies core DOM objects of exceptions or notifications.
constants The following constants define the code
Valid values of the attribute.Note:
These constants are static properties of DOMException, not properties of individual exception objects.
Indicates an index overflow error for an array or string.
DOMSTRING_SIZE_ERR
Indicates that the requested text is too large, and the specified range of text does not fit into a DOMString.
HIERARCHY_REQUEST_ERR
Indicates that an operation to place a node in an illegal position in the document tree hierarchy occurred.
WRONG_DOCUMENT_ERR
Indicates that an operation using the node from a document other than the document from which the node was created occurred.
INVALID_CHARACTER_ERR
Indicates that an illegal character has been used (e.g., in an element name).
NO_DATA_ALLOWED_ERR
Data is specified for a Node that does not support data.
NO_MODIFICATION_ALLOWED_ERR
Indicates that an operation to modify a read-only, non-modifiable node occurred.
NOT_FOUND_ERR
Indicates that the specified node was not found at the expected location.
NOT_SUPPORTED_ERR
Indicates that the current DOM implementation does not support a certain attribute or method.
INUSE_ATTRIBUTE_ERR
An operation to associate an Attr node with another Element node occurred when an Attr node was already associated with another Element node.
INVALID_STATE_ERR
Indicates that an object that is in an unauthorized or no longer authorized state is used.
SYNTAX_ERR
Indicates that the specified error contains a syntax error. It is usually used by CSS attribute declarations.
INVALID_MODIFICATION_ERR
Indicates that an operation has occurred to modify the CSSRule object or the CSSValue object.
NAMESPACE_ERR
Indicates that there is an error involving the namespace of elements or attributes.
INVALID_ACCESS_ERR
Indicates that the object is accessed using a method that is not supported by the current implementation.
code Property
Error code. Provides detailed information about the cause of the exception. The valid values (and their meanings) of this property are defined by the constants listed earlier.
Description
A DOMException object is thrown when a DOM property or method is used incorrectly or in an inappropriate environment. The value of the code property explains the general type of the exception that occurred. Note that it is possible to throw a DOMException object when reading or writing the properties of an object or when calling the methods of an object.
In the XML DOM reference manual provided by CodeW3C.com, the description part of the object's properties and methods lists the exceptions that may be thrown.
Note that not all exceptions in DOM are notified by DOMException: exceptions involving the DOM Range module will cause RangeException to be thrown.
- Previous Page DOM DocumentType
- Next Page DOM Implementation