当我想要包含一个datepicker小部件时,我遇到了问题。 我想在这里做:enter link description here。 我在这里下载了zip:enter link description here
这是我的HTML代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery-ui-1.10.4.custom"></script>
<script src="js/jquery-ui-1.10.4.custom.min"></script>
<script>
$(function () {
$("#from").datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function (selectedDate) {
$("#to").datepicker("option", "minDate", selectedDate);
}
});
$("#to").datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function (selectedDate) {
$("#from").datepicker("option", "maxDate", selectedDate);
}
});
});
</script>
</head>
<body>
<div><label for="from">From</label>
<input type="text" id="from" name="from"/>
<label for="to">to</label>
<input type="text" id="to" name="to"/>
</div>
<br />
<table id="table_campaigns" class="display">
<caption style="font-size:20px">Statistiek 6</caption>
<thead>
</thead>
<tbody>
</tbody>
</table>
<br />
<br />
<table id="table1" class="display">
<thead>
</thead>
<tbody>
</tbody>
</table>
</body>
</html>
我有这个:SyntaxError:语法错误
我是否下载了正确的拉链?怎么了?
答案 0 :(得分:2)
<script src="js/jquery-ui-1.10.4.custom"></script>
<script src="js/jquery-ui-1.10.4.custom.min"></script>
不要同时使用其中之一......
你的文件名也错了,你遗漏了.js
答案 1 :(得分:1)
来自http://api.jqueryui.com/1.8/datepicker/
Additional Notes:
This widget requires some functional CSS, otherwise it won't work.
If you build a custom theme, use the widget's specific CSS file as a starting point.
你应该包括jquery-ui.css