2015-05-27 48 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> 
相關問題