Programmer's Guide > Interfaces > ARange interface > insertNodeWithFixup method
  
insertNodeWithFixup method
This method inserts a Node to the position specified by the start of this Range. It will try to add required ancestors or descendents to make context compliant with VAL_SCHEMA validity type. If the start container of the range is a text node it will be split and the node will be inserted between the two resulting text nodes.
insertNodeWithFixup(node )
Parameters
Nodenode
The Node to be inserted.
Returns
Range. The Range inserted.
Throws
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of the start of the Range is read-only.
WRONG_DOCUMENT_ERR: Raised if newNode and the container of the start of the Range were not created from the same document.
HIERARCHY_REQUEST_ERR: Raised if the container of the start of the Range is of a type that does not allow children of the type of newNode or if newNode is an ancestor of the container.
INVALID_STATE_ERR: Raised if detach() has already been invoked on this object.
RangeException
INVALID_NODE_TYPE_ERR: Raised if newNode is an Attr, Entity, Notation, or Document node.