jQuery Datepicker 在 Safari 中工作,但在 FF 或 Chrome 中不工作
jQuery Datepicker working in Safari, but not FF or Chrome
我已经简化了代码,希望它更容易理解。
HTML
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" media="all"
href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/smoothness/jquery-ui.css"/>
<div type="text" id="datepicker">
Javascript
$(function() {
$("#datepicker").datepicker();
});
我已经将我的 HTML 和 javascript 文件上传到学校的主机 space here。当我在 Safari 上访问 link 时,日历显示正常,但当我在 Firefox 或 Chrome 上打开它时,没有任何反应。
如有任何帮助,我们将不胜感激!
您的学校托管使用 SSL,因此它是 https://
link。
当用户访问通过 HTTP 提供的页面时,他们的连接会打开以进行窃听和中间人攻击。
当用户访问通过 HTTPS 提供的页面时,他们与 Web 服务器的连接将通过 SSL 进行身份验证和加密,从而防止窃听和中间人攻击。
但是,如果 HTTPS 页面包含 HTTP 内容,即使主页是通过 HTTPS 提供的,攻击者也可以读取或修改 HTTP 部分。
当 HTTPS 页面包含 HTTP 内容时,我们称该内容为“混合”。用户正在访问的网页仅部分加密,因为某些内容是通过 HTTP 未加密检索的。
Chrome 并且 Firefox 现在有 Mixed Content Blockers 可以阻止 HTTPS 页面上的某些 HTTP 请求。
出于安全原因,当页面使用 https
.
加载这些脚本时,Firefox 和 Chrome 将阻止任何未从 https
地址加载的脚本
要修复它,只需将脚本的 URL 从
更改为
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
至
https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
Google 两者都支持。
并使用 jQuery 的当前版本,1.4 版已有 5 年历史!
我已经简化了代码,希望它更容易理解。
HTML
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" media="all"
href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/smoothness/jquery-ui.css"/>
<div type="text" id="datepicker">
Javascript
$(function() {
$("#datepicker").datepicker();
});
我已经将我的 HTML 和 javascript 文件上传到学校的主机 space here。当我在 Safari 上访问 link 时,日历显示正常,但当我在 Firefox 或 Chrome 上打开它时,没有任何反应。
如有任何帮助,我们将不胜感激!
您的学校托管使用 SSL,因此它是 https://
link。
当用户访问通过 HTTP 提供的页面时,他们的连接会打开以进行窃听和中间人攻击。
当用户访问通过 HTTPS 提供的页面时,他们与 Web 服务器的连接将通过 SSL 进行身份验证和加密,从而防止窃听和中间人攻击。
但是,如果 HTTPS 页面包含 HTTP 内容,即使主页是通过 HTTPS 提供的,攻击者也可以读取或修改 HTTP 部分。
当 HTTPS 页面包含 HTTP 内容时,我们称该内容为“混合”。用户正在访问的网页仅部分加密,因为某些内容是通过 HTTP 未加密检索的。
Chrome 并且 Firefox 现在有 Mixed Content Blockers 可以阻止 HTTPS 页面上的某些 HTTP 请求。
出于安全原因,当页面使用 https
.
https
地址加载的脚本
要修复它,只需将脚本的 URL 从
更改为http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
至
https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
Google 两者都支持。
并使用 jQuery 的当前版本,1.4 版已有 5 年历史!