from jQuery website:
As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers.
with version 1.7.1 i
Converting code from using .live
to .on
isn't just a case of replacing the calls to .live
with .on
calls. They accept different arguments, and are called on different selectors. For example, the old syntax:
$('a').live('click', function () {});
With .on
:
$(document).on('click', 'a', function () {});
This syntax gives you greater control and flexibility.
I would recommend reading the documentation: http://api.jquery.com/on/
And for information on converting to .on
from .live
:
http://api.jquery.com/live/