gpt4 book ai didi

javascript - Jquery UI Datepicker 不适用于 Jquery 2.0.3

转载 作者:行者123 更新时间:2023-11-29 16:13:05 25 4
gpt4 key购买 nike

一个简单的问题,我有这个 Code使用 jquery2.0.3 版本实现 jquery ui datepicker,但我无法使其工作。我不知道是否有问题或我错过了什么。我正在关注这个文档。正如我的代码jqueryUI datepicker tutorial


这是我的代码

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Select a Date Range</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-2.0.3.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></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>

<label for="from">From</label>
<input type="text" id="from" name="from">
<label for="to">to</label>
<input type="text" id="to" name="to">


</body>
</html>

谁能帮帮我。提前致谢。

最佳答案

您需要在 fiddle 中的 jQuery UI 之前包含 jQuery 核心库,因为 jQuery UI 需要核心 jQuery 才能工作。

Updated Fiddle

关于javascript - Jquery UI Datepicker 不适用于 Jquery 2.0.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22625361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com