I am curious why when I replace .live() with .on() my events don\'t work after inserting AJAX\'s response via html() method. Assume I
It is indeed a replacement for .delegate and .live, but you have to pass in some additional parameters:
var container = $('.a').on('click', '.alert-link', function() {
alert('abc');
return false;
}).on('click', '.ajax-update', function() {
// something that uses AJAX to update .a, like:
container.load('some-url');
return false;
});
For more information, see the documentation.