# DOMException : Object
Return to: HTML DOM Level 2 index

Interface defining error codes for DOM-related processing exceptions.

## Platform Support

IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | ---
6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

## Constructors

Constructor | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
DOMException Constructor() : DOMException Interface defining error codes for DOM-related processing exceptions. | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

### DOMException() : DOMException

Interface defining error codes for DOM-related processing exceptions.

Returns

DOMException |

Visibility
  internal

## Properties

Property | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
INDEX_SIZE_ERR : Number Thrown if the index or size is either negative or greater than the allowed value. | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

Availability

  HTML DOM Level 2|W3C

DOMSTRING_SIZE_ERR : Number Code used when the specified range of text cannot fit into a String. | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

HIERARCHY_REQUEST_ERR : Number Code used when a node is inserted where it doesn't belong | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

WRONG_DOCUMENT_ERR : Number Code used when the node being specified does not exist in the current document | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

INVALID_CHARACTER_ERR : Number Code used when an illegal character is used | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

NO_DATA_ALLOWED_ERR : Number Code used when data is supplied to a node that does not support it | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

NO_MODIFICATION_ALLOWED_ERR : Number Code used when modifications are made to an object where modifications are not permitted | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

  HTML DOM Level 2|W3C

NOT_FOUND_ERR : Number Code used when a node is referenced that does not exist in the current context | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

NOT_SUPPORTED_ERR : Number Code used when the implementation does not support the requested type or object | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

INUSE_ATTRIBUTE_ERR : Number Code used when an added attribute that already exists elsewhere | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

  HTML DOM Level 2|W3C

INVALID_STATE_ERR : Number Code used when an object is used that no longer exists | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

SYNTAX_ERR : Number Code used when an invalid string is specified | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

INVALID_MODIFICATION_ERR : Number Code used when an attempt is made to change the type of an object | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

  HTML DOM Level 2|W3C

NAMESPACE_ERR : Number Code used when a change is made that is invalid in relation to namespaces | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

INVALID_ACCESS_ERR : Number Code used when an operation is not supported by an object | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

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

code : Number Code corresponding to the type of DOMException thrown. | Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

Availability

  HTML DOM Level 2|W3C

## 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

text_javascript aptana_docs