我正在使用datetimepicker而且我遇到了问题:未捕获TypeError:$(...)。datetimepicker不是函数。 我无法解决它。帮帮我...
我的lib
<link href="../css/bootstrap.min.css" rel="stylesheet">
<script src="../js/datapicker/jquery.js"></script>
<script src="../js/datapicker/jquery.datetimepicker.js"></script>
<link href="../css/metisMenu.min.css" rel="stylesheet">
<link href="../css/dataTables/dataTables.bootstrap.css" rel="stylesheet">
<link href="../css/dataTables/dataTables.responsive.css" rel="stylesheet">
<link href="../css/startmin.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css">
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
代码:
<div>
Tadbirkorlik sifatida ro'yhatdan otkazish inspeksiyasida royhatdan otgan sana
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" style="width: 1005px"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
</div>
答案 0 :(得分:2)
我看不到包含bootstrap的javascript,尝试添加它然后查看它是否有效。您还必须在.min.js或.js文件之间进行选择,不应包含它们。做这样的事没有意义。
希望这会有所帮助:)
答案 1 :(得分:1)
请您替换以下代码
$('#datetimepicker1').datetimepicker();
用这个再试一次
$('#datetimepicker1 input').datetimepicker();
也请删除此行之一
<script src="../js/datapicker/jquery.js"></script>
<script src="../js/datapicker/jquery.min.js"></script>
你正在加载jquery两次。