DOMException : Object

Interface defining error codes for DOM-related processing exceptions.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
6.0+1.0+6.0+7.0+1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
Interface defining error codes for DOM-related processing exceptions.
6.0+1.0+6.0+7.0+1.0+no
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
Thrown if the index or size is either negative or greater than the allowed value.
6.0+1.0+6.0+7.0+1.0+no
 
Code used when the specified range of text cannot fit into a String.
6.0+1.0+6.0+7.0+1.0+no
 
Code used when a node is inserted where it doesn't belong
6.0+1.0+6.0+7.0+1.0+no
 
Code used when the node being specified does not exist in the current document
6.0+1.0+6.0+7.0+1.0+no
 
Code used when an illegal character is used
6.0+1.0+6.0+7.0+1.0+no
 
Code used when data is supplied to a node that does not support it
6.0+1.0+6.0+7.0+1.0+no
 
Code used when modifications are made to an object where modifications are not permitted
6.0+1.0+6.0+7.0+1.0+no
 
Code used when a node is referenced that does not exist in the current context
6.0+1.0+6.0+7.0+1.0+no
 
Code used when the implementation does not support the requested type or object
6.0+1.0+6.0+7.0+1.0+no
 
Code used when an added attribute that already exists elsewhere
6.0+1.0+6.0+7.0+1.0+no
 
Code used when an object is used that no longer exists
6.0+1.0+6.0+7.0+1.0+no
 
Code used when an invalid string is specified
6.0+1.0+6.0+7.0+1.0+no
 
Code used when an attempt is made to change the type of an object
6.0+1.0+6.0+7.0+1.0+no
 
Code used when a change is made that is invalid in relation to namespaces
6.0+1.0+6.0+7.0+1.0+no
 
Code used when an operation is not supported by an object
6.0+1.0+6.0+7.0+1.0+no
 
Code corresponding to the type of DOMException thrown.
6.0+1.0+6.0+7.0+1.0+no
 

Remarks

When some exceptional error situations arise during DOM manipulation, the method or object will raise an exception using the appropriate result code. Usually DOM methods will return specific error codes that correspond to the error involved and will not throw an exception. Therefore, this method will only be used in situations where the operation is impossible to recover from or perform. This usually arises when data is lost, the implementation is unstable, or for logical reasons.

References

EventException | RangeException

Availability

HTML DOM Level 2 | W3C

Constructor Detail

DOMException DOMException()

Interface defining error codes for DOM-related processing exceptions.

Visibility
internal

Property Detail

Number INDEX_SIZE_ERR - read only

Thrown if the index or size is either negative or greater than the allowed value.

Availability

HTML DOM Level 2 | W3C

Number DOMSTRING_SIZE_ERR - read only

Code used when the specified range of text cannot fit into a String.

Remarks
Constant defining the error code for when the specified range of text won't fit in a String value.
Availability

HTML DOM Level 2 | W3C

Number HIERARCHY_REQUEST_ERR - read only

Code used when a node is inserted where it doesn't belong

Remarks
When a node is inserted somewhere in the DOM tree where it doesn't belong (for instance, a Attr node as a child of Text), this error code is used.
Availability

HTML DOM Level 2 | W3C

Number WRONG_DOCUMENT_ERR - read only

Code used when the node being specified does not exist in the current document

Remarks
This code is used when a node is used in a different document than the one in which it exists.
Availability

HTML DOM Level 2 | W3C

Number INVALID_CHARACTER_ERR - read only

Code used when an illegal character is used

Remarks
When an invalid or illegal character is used in some method, or for an attribute, this error code is used. This is often used for element or attribute names, for instance.
Availability

HTML DOM Level 2 | W3C

Number NO_DATA_ALLOWED_ERR - read only

Code used when data is supplied to a node that does not support it

Remarks
This code is used when an attempt is made to supply data to a node that does not support data.
Availability

HTML DOM Level 2 | W3C

Number NO_MODIFICATION_ALLOWED_ERR - read only

Code used when modifications are made to an object where modifications are not permitted

Remarks
This code is used when an attempt is made to modify an object that cannot be modified.
Availability

HTML DOM Level 2 | W3C

Number NOT_FOUND_ERR - read only

Code used when a node is referenced that does not exist in the current context

Remarks
This code is used when a node is used that does not exist in the context in which the operation is taking place.
Availability

HTML DOM Level 2 | W3C

Number NOT_SUPPORTED_ERR - read only

Code used when the implementation does not support the requested type or object

Remarks
This code is used when the current implementation does not support the type of object or datatype requested.
Availability

HTML DOM Level 2 | W3C

Number INUSE_ATTRIBUTE_ERR - read only

Code used when an added attribute that already exists elsewhere

Remarks
When an attribute is added when it is already in use elsewhere, this error code is used.
Availability

HTML DOM Level 2 | W3C

Number INVALID_STATE_ERR - read only

Code used when an object is used that no longer exists

Remarks
This code is used when an attempt is made to use an object that is no longer usable, or no longer exists.
Availability

HTML DOM Level 2 | W3C

Number SYNTAX_ERR - read only

Code used when an invalid string is specified

Remarks
This code is used when there is some syntax error, where the specified string is illegal or invalid.
Availability

HTML DOM Level 2 | W3C

Number INVALID_MODIFICATION_ERR - read only

Code used when an attempt is made to change the type of an object

Remarks
This code is used when an attempt is made to modify the type of an object.
Availability

HTML DOM Level 2 | W3C

Number NAMESPACE_ERR - read only

Code used when a change is made that is invalid in relation to namespaces

Remarks
This code is used when an attempt is made to change or create an object in such a way that is invalid with regard to namespaces.
Availability

HTML DOM Level 2 | W3C

Number INVALID_ACCESS_ERR - read only

Code used when an operation is not supported by an object

Remarks
This error code is used when an operation or parameter is called on an object that doesn't support it.

Number code

Code corresponding to the type of DOMException thrown.

Availability

HTML DOM Level 2 | W3C