klyn.io.xml.dom.XMLNode.insertBefore
method
public insertBefore(newChild as Node, refChild as Node) as Node throws DOMException
Description

Inserts a node, or the ordered children of a document fragment, before a reference child. All hierarchy checks precede changes to either tree.

Parameters
ParameterDescription
newChildNode or fragment to insert.
refChildExisting child, or null to append.
Returns

The supplied node; an inserted fragment is left empty.

Throws
  • DOMException for invalid hierarchy, ownership or reference child.
Example

root.insertBefore(child, root.firstChild)