XML DOM insertData() method
Definition and usage
The insertData() method inserts the string Text or Comment node.
Syntax:
CharacterData.insertData(start,string)
Parameter | Description |
---|---|
start | Required. The character position to insert the string into the Text node or Comment node. |
string | Required. The string to be inserted. |
Throw
This method can throw exceptions with the following codes DOMException exception:
INDEX_SIZE_ERR - Parameter start or length is negative, or length greater than the length of the Text node or Comment node.
NO_MODIFICATION_ALLOWED_ERR - The node is read-only and cannot be modified.
Description
This method will insert the specified string string Insert Text node or Comment node at the specified position start at the text location.
related pages
XML DOM reference manual:Text.insertData()
XML DOM reference manual:Comment.insertData()