【发布时间】:2014-01-23 07:44:09
【问题描述】:
这是我面临的错误:
Uncaught TypeError: Object [object Object] has no method 'datepicker' myquery.js:13
(anonymous function) myquery.js:13
fire jquery.js:3049
self.fireWith jquery.js:3161
jQuery.extend.ready jquery.js:434
completed
myquery.js 的代码如下:
jQuery(function($){
$("#datepicker").datepicker({
dateFormat: 'yy-mm-dd'
});
});
在我的 application.js 我有:
//= require jquery
//= require myquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
在我的 application.html.erb 我有这个:
<%= stylesheet_link_tag "http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" %>
真 %>
最后我的 index.html.erb 说:
<label for="date">Date</label>
<input type="text" id="datepicker"></p>
我已经尝试了几乎所有关于 stackoverflow 的答案,但没有任何收获。请告诉我该怎么做...
【问题讨论】:
标签: javascript jquery ruby-on-rails jquery-ui datepicker