首页 > 其他 > 详细

Uncaught TypeError: Object [object Object] has no method 'live'

时间:2015-03-27 10:37:54      阅读:263      评论:0      收藏:0      [点我收藏+]

$( selector ).live( events, data, handler );                // jQuery 1.3+
$( document ).delegate( selector, events, data, handler );  // jQuery 1.4.3+

$( document ).on( events, selector, data, handler );        // jQuery 1.7+

原来 live 是老版 支持 的,新版换方法了。学学吧。

$(document).on("click", ".classname", function(){

 

});

 

$( "a.offsite" ).live( "click", function() {
  alert( "Goodbye!" ); // jQuery 1.3+
});
$( document ).delegate( "a.offsite", "click", function() {
  alert( "Goodbye!" ); // jQuery 1.4.3+
});
$( document ).on( "click", "a.offsite", function() {
  alert( "Goodbye!" );  // jQuery 1.7+
});

Uncaught TypeError: Object [object Object] has no method 'live'

原文:http://www.cnblogs.com/lp-zy/p/4371019.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!