gpt4 book ai didi

javascript - $(...).datepicker 不是函数

转载 作者:行者123 更新时间:2023-11-28 01:12:02 25 4
gpt4 key购买 nike

Datepicker 无法在此页面运行,但导入了 jquery-ui 的脚本。冲突在哪里?谢谢。Datepicker 不是函数这是我的脚本

$( document ).ready(function() {    
var fecha = "";
$( "#datepicker" ).datepicker({
dateFormat: "yy-mm-dd",
});
});

$( "#datepicker" ).change(function(){
fecha = this.value;
$.post( "tablaUsuarioPlanta.php",{fecha : fecha},function(data){
$("#tabla").html(data);
});
});

这是 HTML

<p>Date: <input type="text" id="datepicker" size="30"></p>

然后脚本加载到页面上

<script  src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js">    </script>


<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<!-- Bootstrap Core CSS -->
<link href="../css/bootstrap.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link href="../css/simple-sidebar.css" rel="stylesheet">

<!--JQUERY-->
<!--<script src="../js/jquery.js"></script>-->

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

最佳答案

您正在使用两个版本的 JQuery,这造成了冲突。只使用一个而不是两个。

 <script  src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"> </script>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="../css/simple-sidebar.css" rel="stylesheet">
<!--JQUERY-->
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

关于javascript - $(...).datepicker 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37252623/

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