om.DomNode.insertBefore

Inserts an existing node before the existing node specified.

Syntax

insertBefore(
   new om.DomNode,
   existing om.DomNode)
  1. new is a reference to a new created node.
  2. existing is a reference to a child node existing in the current node.

Usage

The insertBefore() method takes an existing om.DomNode element node and adds it before the child node passed as second parameter, in the list of children of the object node calling the method.

The child node passed to the insertChild() method must have been created from the same DOM document object, for example with the om.DomDocument.createElement() method.

Example

DEFINE parent, other, child om.DomNode
...
LET child = mydoc.createElement("Item")
CALL parent.insertBefore(child, other)