In the old days, we used to use jQuery's .live()
(http://api.jquery.com/live/) to bind to future events, if content was reloaded via AJAX, for example.
Since .live()
is now deprecated (and removed), jQuery suggest the use of .on()
( http://api.jquery.com/on/) instead. They do not state that it works for future events. Incidentally, it's not working on elements reloaded via AJAX.
My question; does .on()
work, or is it supposed to work for future events, in the way that .live()
does/used to?
I'm calling .on()
as follows:
$j('#header-cart').on('click', '.skip-link-close', function(e) {
... // change the world
});
Thanks.