Skip to content

Live

Attaches a change event handler to the specified XPath.

1
myXml.Live(callback: (e: `CurrentTarget` : Xml

Gets the XML node to which the event handler is attached.

Target : Xml
Gets the XML node on which the event occurred.) => void):void

Attaches a change event handler to the specified XPath.

1
myXml.Live(xpath: string, callback: (e: `CurrentTarget` : Xml

Gets the XML node to which the event handler is attached.

Target : Xml
Gets the XML node on which the event occurred.) => void):void

Parameters

(e: CurrentTarget : Xml
Gets the XML node to which the event handler is attached.

Target : Xml
Gets the XML node on which the event occurred.) => void callback
    The callback function to execute.

string xpath
    The XPath of the nodes to attach to. If not specified, the current node is selected.

Remarks

This method attaches to both existing nodes and nodes created later.

This method is only available in client-side scripts such as Form scripts. This method attaches to both existing nodes and nodes created later.

This method is only available in client-side scripts such as Form scripts.

Receive an alert when the order count changes

1
2
3
$Xml.Live('//Order/Count', function() {
  alert('Order count changed.');
});

Receive an alert for any change to all

Order/Count nodes

1
2
3
$Xml.Live('//Order/Count', function() {
  alert('Order count changed.');
});

See Also