$.udb.on()
note
This article is about the on() function of the udb object.
$.udb.on()
Binds a handler to an event (in the same way as in the jQuery implementation) on application level of the web application.
Returns the UdbApplication object.
Syntax
$.udb.on( *eventType*, [data], *handler(event)* )
The required eventType is a string that identifies the event to bind to. The possible values for the eventType parameter are described in the Events reference section.
The optional data is a key-value JSON object that contains certain data options to be passed to the event as its event.data object.
The required handler(event) is the event handler function that contains the event logic to be bound with the given eventType to the application.
Example
function OnCommit(event, options) {
if (options.success)
console.log('Commit succeeded');
else
console.warn('Commit failed');
}
$.udb.on('postcommit', OnCommit);