admin管理员组文章数量:1316645
I'm experiencing an issue with the jQuery CDN.
Given the following script imports:
<script type="text/javascript" src=".9.1.js"></script>
<script type="text/javascript" src=".10.3/jquery-ui.js"></script>
I am having the following issues with the CDN paths:
- Using
http://...
when accessing my site over SSL I get[blocked] The page at / ran insecure content from .9.1.js.
- Using
https://...
seems a bit dodgy if not accessing site over SSL - Using
//...
causes both the imports to fail on GET.
I'm experiencing an issue with the jQuery CDN.
Given the following script imports:
<script type="text/javascript" src="http://code.jquery./jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery./ui/1.10.3/jquery-ui.js"></script>
I am having the following issues with the CDN paths:
- Using
http://...
when accessing my site over SSL I get[blocked] The page at https://www.example./ ran insecure content from http://code.jquery./jquery-1.9.1.js.
- Using
https://...
seems a bit dodgy if not accessing site over SSL - Using
//...
causes both the imports to fail on GET.
- 2 how are you saying the third option is failing – Arun P Johny Commented Sep 23, 2013 at 16:59
-
3
did you try
<script type="text/javascript" src="//code.jquery./jquery-1.9.1.js"></script>
, it seems fine plnkr.co/edit/6uFktr3TaBMWbEUdsvmZ?p=preview – Arun P Johny Commented Sep 23, 2013 at 16:59 - 1 it will fail if you are loading the page from local file system instead of a web server – Arun P Johny Commented Sep 23, 2013 at 17:01
- @ArunPJohny Ahh - would that happen even on a local IIS? – dav_i Commented Sep 23, 2013 at 17:03
-
no... if it is loading from a local web server with
http://
orhttps://
address it will work fine – Arun P Johny Commented Sep 23, 2013 at 17:05
1 Answer
Reset to default 10just omit the protocol, then the script will be loaded using the same protocol as the page
<script type="text/javascript" src="//code.jquery./jquery-1.9.1.js"></script>
<script type="text/javascript" src="//code.jquery./ui/1.10.3/jquery-ui.js"></script>
But if the resource is loaded form the file system(with file:// protocol) then this will not work
本文标签: javascriptjQuery CDN secureinsecure loading issuesStack Overflow
版权声明:本文标题:javascript - jQuery CDN secureinsecure loading issues - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741956257a2407005.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论