In jQuery v1.7 a new method, on was added. From the documentation:
‘The .on() method attaches event handlers to the currently se
on
is in nature very close to delegate
. So why not use delegate? It's because on
doesn't come alone. there's off
, to unbind event and one
to create an event to be executed one time only. This is a new event's "package".
The main problem of live
is that it attaches to "window", forcing a click event (or other event) on an element deep inside the page structure (the dom), to "bubble up" to the top of the page to find an event handler willing to deal with it. At each level, all event handlers have to be checked, this can add up fast, if you do deep imbrication (