2013-03-08 85 views
0

它看起來這個可jeditable對象的虛擬錯誤。這是我的jQuery可jeditable錯誤對象[對象對象]沒有方法'可編輯'

<script src="/assets/jquery.js?body=1" type="text/javascript"></script> 
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-transition.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-alert.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-modal.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-dropdown.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-scrollspy.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-tab.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-tooltip.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-popover.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-button.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-collapse.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-carousel.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-typeahead.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap/bootstrap-affix.js?body=1" type="text/javascript"></script> 
<script src="/assets/twitter/bootstrap.js?body=1" type="text/javascript"></script> 
<script src="/assets/bootstrap.js?body=1" type="text/javascript"></script> 
<script src="/assets/mgm.js?body=1" type="text/javascript"></script> 
<script src="/assets/swimming/classschedules.js?body=1" type="text/javascript"></script> 
<script src="/assets/swimming/coaches.js?body=1" type="text/javascript"></script> 
<script src="/assets/swimming/programs.js?body=1" type="text/javascript"></script> 
<script src="/assets/swimming/shoppings.js?body=1" type="text/javascript"></script> 
<script src="/assets/swimming/students.js?body=1" type="text/javascript"></script> 
<script src="/assets/underscore-min.js?body=1" type="text/javascript"></script> 
<script src="/assets/backbone-min.js?body=1" type="text/javascript"></script> 
<script src="/assets/jquery.jeditable.mini.js?body=1" type="text/javascript"></script> 
<script src="/assets/application.js?body=1" type="text/javascript"></script> 



<div class="edit" id="dev008">click to edit</div> 

$(function() { 
    $('.edit').editable('<%= date_swimming_classschedules_path(@date)%>'); 
}); 

頁,我得到這個錯誤

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

而且我已經檢查

src="/assets/jquery.jeditable.mini.js?body=1" 

可達。是否還有其他事情我應該檢查以解決這個錯誤?在Chrome控制檯

Uncaught TypeError: Object [object Object] has no method 'editable' er:236 
(anonymous function) er:236 
y.Callbacks.l application.js:14 
y.Callbacks.c.fireWith application.js:14 
y.extend.ready application.js:14 
M application.js:14 

UPDATE

完整的錯誤消息。

我發現這條線

<script src="/assets/application.js?body=1" type="text/javascript"></script> 

只是

<script src="/assets/jquery.jeditable.mini.js?body=1" type="text/javascript"></script> 

後jQuery庫的副本。我怎樣才能刪除這條線?

更新2

我加入相關的Rails代碼

/app/assets/application.js代碼

//= require jquery 
//= require jquery_ujs 
//= require twitter/bootstrap 
//= require underscore-min.js 
//= require backbone-min.js 
//= require jquery.jeditable.mini.js 

/app/views/layouts/application.html.erb代碼

<%= javascript_include_tag "application" %> 

謝謝

+0

是否有任何其他錯誤? (例如,加載錯誤) – 2013-03-08 04:09:25

+0

@JaredForsyth我剛剛更新了原始帖子 – wwli 2013-03-08 04:18:20

+0

打開螢火蟲,並查看控制檯中顯示的JS錯誤。 – Pushkar 2013-03-08 04:22:37

回答

2

查找application.js(中/資產/)和刪除的內容(或做一些事情,使得它不再包含的jQuery的另一個副本)

:)

+0

哇,謝謝很多人!/public/assets /中有一個application.js文件。我刪除它後,現在都很好:) – wwli 2013-03-08 04:45:51

+0

很高興幫助! :) – 2013-03-08 04:47:03

相關問題