问题描述
我一直在尝试使用bootstrap datetimepicker并在我的脚本上拥有所有组件,如Moment JS,bootstrap-date-time js和bootstrap js,但我得到g.size()不是函数错误。我正在尝试运行以下函数
I have been trying to use bootstrap datetimepicker and have all the components on my scripts like Moment JS, bootstrap-date-time js, and bootstrap js but I am getting g.size() is not a function error. I am trying to run the following function
$(function(){
$('#datetimepicker').datetimepicker();
});
推荐答案
我遇到了和你一样的错误,我无法在任何地方找到解决方案。实际上对 g.size()的唯一引用不是函数
错误就是这个问题,当时只有一次投票。
I had the same error as you, and I could not find a solution for it anywhere. In fact the only reference to the g.size() is not a function
error was this question, at the time with only a single down vote.
我发现了这个:,它很容易上班:
I found this one: https://github.com/xdan/datetimepicker, it was quite easy to get working:
-
包含文件:
- download the zip from github
Include the files :
< link href =./ js / datetimepicker-master /build/jquery.datetimepicker.min.cssrel =stylesheet>
< script src =./ js / datetimepicker-master / build / jquery.datetimepicker.full.min.js>< / script>
<link href="./js/datetimepicker-master/build/jquery.datetimepicker.min.css" rel="stylesheet"><script src="./js/datetimepicker-master/build/jquery.datetimepicker.full.min.js"></script>
此HTML
< input id =datetimepickertype =text/>
<input id="datetimepicker" type="text" />
这个JS
$。datetimepicker.setLocale('en');
$('#datetimepicker')。 datetimepicker();
$.datetimepicker.setLocale('en');
$('#datetimepicker').datetimepicker();
我得到了这个,工作的时间只有我浪费的一小部分时间试图让bootstrap datetimepicker停止给我 g.size()
错误。
I got this up and working in a tiny fraction of the amount of time I'd wasted trying to get the bootstrap datetimepicker to stop giving me the g.size()
error.
当然还有许多其他日期时间选择器可用:
Of course there are many other datetime pickers available:
这篇关于g.size()不是函数 - Jquery错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!