2015-05-27 108 views
-2

我想第一次使用jquery,但我无法使它工作。JQuery datepicker不适用于最新版本

我的代码如下:

<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>jQuery UI Datepicker - Display inline</title> 
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> 
    <script src="//code.jquery.com/jquery-1.10.2.js"></script> 
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
    <script src="@Url.Content("~/Scripts/datepicker/jquery.ui.datepicker.js")" type="text/javascript"></script> 
    <link rel="stylesheet" href="/resources/demos/style.css"> 
    <script> 
    $(function() { 
    $("#datepicker").datepicker(); 
    }); 
    </script> 
</head> 
<body> 

Date: <div id="datepicker"></div> 


</body> 
</html> 
+0

尝试使用浏览器控制台以查找错误。通过http检查脚本标记 http://code.jquery.com/jquery-1.10.2.js http://code.jquery.com/ui/1.11.4/jquery-ui.js – Antony

+0

做什么你想要的是什么? –

回答

1

试试这个..

与日期替换DIV:<input type="text" id="datepicker" />

<html lang="en"> 
    <head> 
     <meta charset="utf-8"> 
     <title>jQuery UI Datepicker - Display inline</title> 
     <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> 
     <script src="//code.jquery.com/jquery-1.10.2.js"></script> 
     <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
     <script src="@Url.Content("~/Scripts/datepicker/jquery.ui.datepicker.js")" type="text/javascript"></script> 
     <link rel="stylesheet" href="/resources/demos/style.css"> 
     <script> 
     $(function() { 
     $("#datepicker").datepicker(); 
     }); 
     </script> 
    </head> 
    <body> 

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

    </body> 
    </html> 
相关问题