Skip to content

XmlNode.Bind

Overview

void XmlNode.Bind ( [ xpath ], [ callback ] )
Attaches an change event handler on specified xpath resulting nodes.

Arguments

String xpath

XPath of nodes to be attached. If not specified current node is selected.

Function callback

Callback function to be execute.

Remarks

This method is only available on client side scripts like Form scripts.

Bind method only attaches to existing nodes, to receive notifications for existing and created nodes in future please use XmlNode.Live method.

Examples

Receive an alert for changing a node

var isNameEmpty = $Xml.Bind('//Customer/Name', function() {
  alert('Customer name is changed');
});

Receive an alert for any change on current document

$Xml.Bind(function() {
  alert( this.LocalName() + ' is changed.');
});

See Also