【发布时间】:2013-09-28 16:14:48
【问题描述】:
我在使用 jQuery CDN 时遇到问题。
鉴于以下脚本导入:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
CDN 路径存在以下问题:
- 通过 SSL 访问我的网站时使用
http://...我得到[已阻止]https://www.example.com/ 的页面运行了来自 http://code.jquery.com/jquery-1.9.1.js 的不安全内容。
- 如果不通过 SSL 访问站点,使用
https://...似乎有点狡猾 - 使用
//...会导致两个导入都在 GET 上失败。
【问题讨论】:
-
你怎么说第三个选项失败了
-
你试过了吗
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>,好像还不错plnkr.co/edit/6uFktr3TaBMWbEUdsvmZ?p=preview -
如果您从本地文件系统而不是 Web 服务器加载页面,它将失败
-
@ArunPJohny Ahh - 即使在本地 IIS 上也会发生这种情况?
-
不...如果它是从具有
http://或https://地址的本地Web 服务器加载的,它将正常工作
标签: javascript jquery html ssl