大网数据广告活动
网站运营与故障问答

jQuery not loading from CDN

· 52CE 我爱测

I have a custom CMS, and for some reason jQuery will not load from the CDN. After sitting on this for days, I remember I made a change the the .htaccess file but not sure if it's really the cause. RewriteEngine on RewriteCond %{R…

问题原文

原帖链接 · Richard Testani · CC BY-SA 3.0

I have a custom CMS, and for some reason jQuery will not load from the CDN. After sitting on this for days, I remember I made a change the the .htaccess file but not sure if it's really the cause.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php|themes|assets|images|coobie|robots\.txt)
RewriteRule ^ index.php [QSA,L]

Would this prevent:

<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>

from loading? The site is on my local computer, so it's requested form https://localhost

How I know jQuery is not loading: When I check the dev tools in Safari it's not listed in the scripts that are loaded. Also my scripts that were working, now log '$' is undefined. The link works fine if I head to it, so something is stopping it.

已采纳解答

原帖链接 · Andrew Lott · CC BY-SA 3.0

You're trying to load a HTTP resource on a HTTPS page. Your browser may be blocking this external resource because it's considered insecure on an otherwise "secure" page.

Change src="http://code.jquery.com/jquery-2.1.4.min.js" to src="https://code.jquery.com/jquery-2.1.4.min.js" and see if that helps.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-02-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。