简体   繁体   English

在本地托管时,日期选择器无法正常工作

[英]Date-picker not working when hosting locally

I am using jQuery 1.10.2 and jQuery ui 1.11.1 and have hosted it locally. 我正在使用jQuery 1.10.2和jQuery ui 1.11.1并在本地托管它。 When giving the extensions from the online source the datepicker works fine, but when I host it locally it doesn't. 当从在线源提供扩展时,datepicker工作正常,但是当我在本地托管它时它没有。

Online extensions 在线扩展

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

Locally hosted extensions 本地托管的扩展程序

<script type="text/javascript" src="date/jquery-1.10.2.js"></script>
<script type="text/javascript" src="date/jquery-ui.js"></script>
<link type="text/css" rel="stylesheet" href="date/jquery-ui.css">

The directory is correct and also have followed the order mentioned in the answer in the link below, but yet it doesn't seem to work. 该目录是正确的,并且也遵循下面链接中答案中提到的顺序,但是似乎不起作用。 Anything else I have missed out? 我还有什么错过的吗? Appreciate any help / suggestion. 感谢任何帮助/建议。

Click here to View the question 点击此处查看问题

You said locally, I assume on file:/// protocol. 你在本地说,我假设在file:/// protocol。 Therefore, your online scripts fallback to file:/// protocol. 因此,您的在线脚本将回退到file:/// protocol。 Fix it by adding http/https: 通过添加http / https来修复它:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM