我有一些trubble有了这个插件:https://github.com/jdewit/bootstrap-timepickerTimepicker:遗漏的类型错误:未定义是不是一个函数
//= require jquery
//= require jquery_ujs
//= require bootstrap-datepicker/js/bootstrap-datepicker
//= require bootstrap-timepicker/js/bootstrap-timepicker
//= require admin/fileupload
//= require admin/category
//= require admin/cars
//= require admin/restaurants
//= require admin/events
//= require zipcodes
的admin/events.js
:
$(document).ready(function(){
$('.timepicker').timepicker();
});
而且我得到了这个错误: Uncaught TypeError:undefined不是函数
任何人都可以帮我吗?
编辑:
这是我用的console.log得到($):
function (selector, context) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init(selector, context);
} VM13723:2
undefined
你有没有包含bootstrap-timepicker.js? –
是 //需要bootstrap-timepicker/js/bootstrap-timepicker 是bootstrap-timepicker.js的一个版本(在RoR中) – p0k3
是你的元素'$('.timepicker')'加载了ajax? – zerzer