$(...).datepicker不是函数 [英] $(...).datepicker is not a function

查看:84
本文介绍了$(...).datepicker不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Datepicker无法在此页面中运行,但是jquery-ui的脚本已导入. 冲突在哪里?谢谢. 日期选择器不是功能 这是我的脚本

Datepicker can´t run in this page, but the script of jquery-ui is imported. Where is the conflict? Thanks. Datepicker is not a function This is my script

$( 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创建冲突.只能使用一个而不是两个.

You are using two version of JQuery that creates the confliction . Use only one instead of two.

 <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>

这篇关于$(...).datepicker不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆