要求是在单击文本框时使用 jquery datepicker。添加了所有 js 引用,但 .datepicker 仍然不是函数错误。代码如下。我错过了什么吗?
错误详情
Uncaught TypeError: $(...).datepicker is not a function
at HTMLDocument.<anonymous> (Index:56)
at c (jquery-1.10.2.min.js:21)
at Object.fireWith [as resolveWith] (jquery-1.10.2.min.js:21)
at Function.ready (jquery-1.10.2.min.js:21)
at HTMLDocument.q (jquery-1.10.2.min.js:21)
代码:
@{
ViewBag.Title = "Index";
}
<!-- Include Date Range Picker -->
<link rel="stylesheet" href="../../Content/bootstrap-datepicker.css" />
<script type="text/javascript" src="../../Scripts/jquery-1.10.2.min.js"> </script>
<script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.min.js"></script>
<script>
$(document).ready(function() {
$(".datepicker").datepicker({ format: 'dd/mm/yyyy', autoclose: true, todayBtn: 'linked' });
});
</script>
<h3>BootStrap Datetime Picker Example</h3>
<hr />
<div>Click textbox to open datetime picker: <input type="text" id="fromDate" class="datepicker" /></div>
<script type="text/javascript" src="../../Scripts/jquery.datetimepicker.js"> </script>