gpt4 book ai didi

javascript - jQuery Datepicker 在 Safari 中工作,但不能在 FF 或 Chrome 中工作

转载 作者:行者123 更新时间:2023-11-28 07:27:16 25 4
gpt4 key购买 nike

我简化了代码,希望能更容易理解。

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 文件上传到学校的托管空间 here 。当我在 Safari 上访问该链接时,日历显示正常,但当我在 Firefox 或 Chrome 上打开它时,没有任何反应。

如有任何帮助,我们将不胜感激!

最佳答案

您的学校托管使用 SSL,因此它是一个 https:// 链接。

当用户访问通过 HTTP 提供服务的页面时,他们的连接会被打开以进行窃听和中间人攻击。
当用户访问通过 HTTPS 提供的页面时,他们与 Web 服务器的连接将通过 SSL 进行身份验证和加密,从而防止窃听者和中间人攻击。

但是,如果 HTTPS 页面包含 HTTP 内容,则攻击者可以读取或修改 HTTP 部分,即使主页是通过 HTTPS 提供的。

当 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 版本已有五年历史了!

关于javascript - jQuery Datepicker 在 Safari 中工作,但不能在 FF 或 Chrome 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29502354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com