[英].live() error for colorbox with jquery rails
我用過rails 4.0.0
也是jquery rails 3.0.4
jquery.colorbox.js v 1.3.19
我有一個鏈接<%= link_to "Upload Image", edit_seller_banner_users_path, class: "photobox" %>
在js中
$('.photobox').click(function(e){
$(this).colorbox();
});
它向我顯示錯誤為TypeError: $(...).live is not a function
在Firebug中TypeError: $(...).live is not a function
,並且鏈接重定向未打開顏色盒... Plz幫助。
從jQuery 1.7開始不推薦使用live()
,並在1.9中將其從源代碼中完全刪除。
您有3個選擇:
on()
與委托參數一起使用。 嘗試在jquery之后在應用程序中使用jQuery-migrate.js。
請檢查http://blog.jquery.com/2013/05/08/jquery-migrate-1-2-1-released/並鏈接http://code.jquery.com/jquery-migrate-1.2.1 .js文件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.