2016-02-16 82 views
0

我想嵌入jQuery UI日期選取器。 我已經得到了代碼從這裏 - https://jqueryui.com/datepicker/似乎無法讓jQuery UI日期選取器正常工作

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>jQuery UI Datepicker - Default functionality</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> 
    <link rel="stylesheet" href="/resources/demos/style.css"> 
    <script> 
    $(function() { 
    $("#datepicker").datepicker(); 
    }); 
    </script> 
</head> 
<body> 

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


</body> 
</html> 

問題是我無法看到實際的日期選擇器,但只有在輸入框中點擊,甚至超過時。是否有任何額外的步驟,我應該通過,以使其工作或有什麼其他錯誤,我在做什麼?

+0

您是否獲得在控制檯中的一些錯誤只需添加http://? – drosam

+0

該代碼似乎爲我工作... –

回答

1

如果你看到控制檯,你會看到這樣的事情

文件:///Users/David/Developer/code.jquery.com/ui/1.11.4/themes/smoothness/jquery- ui.css 加載資源失敗:net :: ERR_FILE_NOT_FOUND file:///Users/David/Developer/code.jquery.com/jquery-1.10.2.js失敗 加載資源:net :: ERR_FILE_NOT_FOUND file :///Users/David/Developer/code.jquery.com/ui/1.11.4/jquery-ui.js 加載資源失敗:net :: ERR_FILE_NOT_FOUND

當您添加的資源,並將努力

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

非常感謝大衛。 – sretko

+0

它完美的作品。 – sretko

+0

不客氣;) – drosam

相關問題