Event Binding in
jQuery
As stated in the
introduction, the HTML Console SDK is based on jQuery. HTML Console
applications can use the jQuery
.on()
method to associate screen events with Javascript actions.
Since version 1.7, jQuery
provides the .on() method for responding to an event on the selected elements.
This is called an event binding. The jQuery model works with events causing
changes to elements in the HTML document object model (DOM).
Event Handler------------------>Change element in the DOM$(object).on('event', function() { ... $("button".attr(...) });
For example, an HTML Console
application can implement screen resize as follows:
$(window).on('resize', function(e) { updateSize(); updateScreen(); });