Skip to content
Maxime LUCE edited this page Feb 25, 2014 · 1 revision

Allow jQuery on (see full documentation) method shortcut data binding.

Samples

Simple sample
<a data-bind="on: { click: myClickHandler }"></a>

is equivalent to

$(selector).on("click", myClickHandler);
Multiple event handler
<a data-bind="on: { click: myClickHandler, mouseover: myMouseOverHandler }"></a>

is equivalent to

$(selector).on({
    click: myClickHandler,
    mouseover: myMouseOverHandler,
});

Options

The on binding handler take an object as arguments.
This object's keys represent event name while values are events handlers.

See full jquery on documentation.

Clone this wiki locally