Programmeren

XML DOM - DOMException-object

Melden van abnormale of meldingen aan het kern DOM-object.

Constanten De onderstaande constanten definiëren de eigenschappen van het DOMException-object code

Geldige waarden van eigenschappen.Opmerking:

Deze constanten zijn statische eigenschappen van DOMException, niet van individuele uitzonderingsobjecten.

Uitleg dat er een indexoverloopfout is opgetreden in een array of string.

DOMSTRING_SIZE_ERR

Uitleg dat de verzoekte tekst te groot is en dat het opgegeven bereik niet geschikt is voor DOMString.

HIERARCHY_REQUEST_ERR

Uitleg dat een actie wordt ondernomen om een knoop op een onwettige positie in de documenthiërarchie te plaatsen.

WRONG_DOCUMENT_ERR

Uitleg dat een knoop wordt gebruikt in een document dat het creëren van de knoop niet heeft gemaakt.

INVALID_CHARACTER_ERR

Uitleg dat onwettige tekens zijn gebruikt (bijvoorbeeld in een elementnaam).

NO_DATA_ALLOWED_ERR

Data wordt toegewezen aan een Node die geen data ondersteunt.

NO_MODIFICATION_ALLOWED_ERR

Uitleg dat een actie is ondernomen om een alleen-lezen, niet te wijzigen knoop te wijzigen.

NOT_FOUND_ERR

Uitleg dat de opgegeven knoop niet is gevonden op de verwachte locatie.

NOT_SUPPORTED_ERR

Uitleg dat de huidige DOM-implementatie een bepaalde eigenschap of methode niet ondersteunt.

INUSE_ATTRIBUTE_ERR

Uitleg dat een Attr-knoop al is verbonden met een Element-knoop en er een actie wordt ondernomen om een Attr-knoop te verbinden met een andere Element-knoop.

INVALID_STATE_ERR

Indicates that an object that is in a state where it is not allowed to be used or is no longer allowed to be used has been 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 occurred to modify a CSSRule object or a CSSValue object.

NAMESPACE_ERR

Indicates that there is an error involving the namespace of an element or attribute.

INVALID_ACCESS_ERR

Indicates that access to an object using a method that is not supported by the current implementation is attempted.

code attribute

Error code. Provides detailed information about the cause of the exception. The valid values (and their meanings) of this attribute are defined by the constants listed earlier.

Description

A DOMException object is thrown when a DOM attribute or method is used incorrectly or in an unsuitable environment. The value of the code attribute 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 calling an object's methods.

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 a RangeException exception to be thrown.