我一直在試圖讓Datepicker for Bootstrap工作,但一直不成功。該datapicker箱從未顯示:不能讓引導日期選擇器工作
<head>
<title>Pick-a-Date</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/datepicker.css">
<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/bootstrap-datepicker.js" type="text/javascript"></script>
</head>
<body>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Select date</h3>
</div>
<div class="panel-body">
<div class="input-append date" id="datepick" data-date="<?=date('m-d-Y', strtotime('-25 hours')) ?>" data-date-format="dd-mm-yyyy">
<input class="span2" size="16" type="text" value="<?=date('m-d-Y', strtotime('-25 hours')) ?>">
<span class="add-on"><i class="icon-calendar"></i></span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$('#datepick').datepicker({
format: "yyyy/mm/dd",
autoclose: true,
todayHighlight: true
});
});
</script>
</body>
這裏是小提琴: http://jsfiddle.net/eComEvo/7svU3/2/
任何想法有什麼不好?
引導-datepicker.js沒有被加載在你的小提琴 - 404個 – dmullings
@dmullings是正確的,你鏈接到一個不存在的文件。順便說一句,在開發JS應用程序時,要習慣於打開JS控制檯。 – Babblo
該網站阻止了直接鏈接。我將完整的代碼從'http:// www.eyecon.ro/bootstrap-datepicker/js/bootstrap-datepicker.js'添加到JS框架中。仍然不起作用。我把它在我的測試服務器上本地下載,所以它不會成爲它失敗的原因。 – eComEvo