我知道這裏已經有很多線程了。我已經閱讀了其中許多內容,並嘗試瞭解決方案,但都無濟於事。
這是我在我的頭上已經有了:
<script src="/Areas/IRF/Scripts/jquery-2.1.3.js"></script>
<script src="/Areas/IRF/Scripts/jquery.inputmask/jquery.inputmask.js"></script>
<script src="/Areas/IRF/Scripts/jquery.validate.js"></script>
<script src="/Areas/IRF/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/Areas/IRF/Scripts/moment.js"></script>
<script src="/Areas/IRF/Scripts/bootstrap-datetimepicker.js"></script>
<script src="/Areas/IRF/Plugins/PNotify/pnotify.custom.min.js"></script>
<script src="/Areas/IRF/Scripts/CustomModules/app-notifications.js"></script>
和一些CSS文件:
<link href="/Areas/IRF/Content/bootstrap.css" rel="stylesheet" />
<link href="/Areas/IRF/Content/bootstrap-datetimepicker.css" rel="stylesheet" />
<link href="/Areas/IRF/Content/typeahead.css" rel="stylesheet" />
<link href="/Areas/IRF/Content/site.css" rel="stylesheet" />
<link href="/Areas/IRF/Plugins/PNotify/pnotify.custom.min.css" rel="stylesheet" />
<link href="/Areas/IRF/Content/irf-theme.css" rel="stylesheet" />
<link href="/Areas/IRF/Plugins/Qtip/jquery.qtip.min.css" rel="stylesheet" />
則...
<script type="text/javascript">
$(document).ready(function() {
... some stuff
});
$(function() {
$('.RequestedResponseDate').datepicker({
format: 'mm/dd/yyyy',
startDate: '-3d'
});
});
</script>
最後...
<div class="input-group date" data-provide="datepicker">
<input class="form-control datepicker valid" data-val="true" data-val-date="The field Requested Response Date must be a date." id="RequestedResponseDate" name="RequestedResponseDate" placeholder="MM/DD/YYYY" type="text" value="" aria-describedby="RequestedResponseDate-error">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
我收到此錯誤:
New:514 Uncaught TypeError: $(...).datepicker is not a function
(anonymous function) @ New:514fire @ jquery-2.1.3.js:3094
self.fireWith @ jquery-2.1.3.js:3206
jQuery.extend.ready @ jquery-2.1.3.js:3412
completed @ jquery-2.1.3.js:3428
我試圖重新排序,其中裁判jQuery的2.1.3.js位於(移動下來),但只是導致其他問題。我也嘗試添加$ .noConflict();
$.noConflict();
$(function() {
$('.RequestedResponseDate').datepicker({
format: 'mm/dd/yyyy',
startDate: '-3d'
});
但是,然後相同的錯誤顯示兩次!
Uncaught TypeError: $ is not a function
(anonymous function) @ New:514
檢查文件是否icluded – giannisf
哪裏是'引導-datetimepicker.js'從 –
未來凱文,不知道你的意思 –