gpt4 book ai didi

jquery-ui - datetimepicker不是函数jQuery

转载 作者:行者123 更新时间:2023-12-03 21:05:08 25 4
gpt4 key购买 nike

我使用datetimepicker jQuery ui,当html以下代码未显示时,datetimepicker未显示,当我用firebug console检查时显示错误``

$("#example1").datetimepicker is not a function
[Break On This Error] $("#example1").datetimepicker();


下面是代码

<link href="css/styles.css" rel="stylesheet" type="text/css">
<link href="css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css">

<style>
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }

.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }

</style>


<script type="text/javascript" src="scripts/jquery.js"></script>

<script type="text/javascript" src="scripts/jquery/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="scripts/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="scripts/jquery/ui/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="scripts/jquery/ui/jquery-ui-sliderAccess.js"></script>

<script>
$(document).ready(function(){
$("#example1").datetimepicker();
});
</script>

<script>

</script>

<input type="text" id="example1" class="hasDatePicker">

最佳答案

请记住,jQuery UI的日期选择器未使用datetimepicker()进行初始化,此处似乎有一个插件/附件:http://trentrichardson.com/examples/timepicker/

但是,仅使用jquery-ui,它实际上已初始化为$("#example").datepicker()。在此处查看jQuery的演示站点:http://jqueryui.com/demos/datepicker/

   $(document).ready(function(){
$("#example1").datepicker();
});


要在上面引用的链接上使用datetimepicker,您需要确定脚本路径对于该插件是正确的。

关于jquery-ui - datetimepicker不是函数jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8678254/

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