JQuery jquery-1.7.1.min.js live() deprecated use on()

穿精又带淫゛_ 提交于 2019-12-02 01:31:01

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/

Specific to the code submitted, as per the ramblings above;

Replace

$(".toBeSaved [col=ISRC] input").on('change',function() {

with

 $(document).on('change','.toBeSaved [col=ISRC] input', function() {
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!