2016-02-16 163 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

相关问题