我尝试使用twitter datepicker.css和bootstrap-datepicker.js创建一个日期选择器,但是没有成功。我在这个项目中使用的是codeigniter。
<input type="text" name="end_date" value="" class="datepicker" data-format="dd-MM-yyyy" />
<script>
$(function() {
$( ".datepicker" ).datepicker();
});
</script>
我已经包括了上面提到的两个文件,但这是不工作。我如何才能使它工作?
我有一个错误(Firebug)--〉“类型错误:$(...).datepicker不是函数”
2条答案
按热度按时间6ie5vjzr1#
You can can use : http://www.eyecon.ro/bootstrap-datepicker/
here's a working example : https://refork.codicode.com/x771
r7knjye22#
red one,
It would be helpful to share a jsFiddle of your code. At least let us know what scripts you are loading and styles you are loading and in which order. Since the datepicker is dependent on jQuery you need to make sure that jQuery is loading before your .js files. You asked about the bootstrap-responsive and bootstrap files. As long as you are linking to the correct one it should work.
Hopefully that gives you a little direction. Will update when you share more information.