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 at which the string is to be inserted into the Text node or Comment node.
string Required. The string to be inserted.

throw

This method can throw a DOMException with the following code 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 a 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()