Javascript jquery';s live()已弃用。我现在用什么?
我在jquery文档中看到,live()已被弃用。有直接更换功能吗?当然有:Javascript jquery';s live()已弃用。我现在用什么?,javascript,jquery,Javascript,Jquery,我在jquery文档中看到,live()已被弃用。有直接更换功能吗?当然有: live()页面显示了如何转换为on(): $(文档).on('event','selector',function(){})替换.live() $('selector')。在('event','selector',function(){})上替换.delegate() $('selector')。在('event',function(){})上替换.bind() 摘自您可以根据jquery的版本查看所有不推荐使用
live()
页面显示了如何转换为on()
:
$(文档).on('event','selector',function(){})代码>替换.live()
$('selector')。在('event','selector',function(){})上代码>替换.delegate()
$('selector')。在('event',function(){})上代码>替换.bind()
摘自您可以根据jquery的版本查看所有不推荐使用的函数
希望这对你有帮助
$('rootselector').on('click', 'selector', function(){
});