这个可裁剪对象看起来是一个虚拟错误。这是我的页面
<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
更新
我发现了这一行
<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 code
//= 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 code
<%= javascript_include_tag "application" %>
由于
答案 0 :(得分:2)
查找application.js
(在/ assets /中)并删除内容(或执行某些操作,使其不再包含jquery的另一个副本)
:)