简体   繁体   English

jQuery不是从CDN加载

[英]jquery is not loading from the cdn

I am using jquery in my web page so I have included the script in my HTML like this: 我在网页中使用jquery,因此我将脚本包含在HTML中,如下所示:

<script type="text/javascript" src="//code.jquery.com/jquery-1.11.2.min.js"></script>

If I try to hit the URL: code.jquery.com/jquery-1.11.2.min.js it will not load for first few attempts. 如果尝试访问URL: code.jquery.com/jquery-1.11.2.min.js ,则前几次尝试均不会加载。 after that it will load. 之后它将加载。 This is happening from past few days. 这是过去几天发生的事情。

These scripts are included at the top of <head> and were working good for past and this problem is occurring from couple of days. 这些脚本包含在<head>的顶部,可以很好地工作,过去几天就出现了此问题。

Is there something wrong in a way I include these or is there some change that happened in jquery? 我包含这些的方式有问题吗,还是jquery中发生了一些变化?

EDIT : In developer tools I can see this: 编辑 :在开发人员工具中,我可以看到:
status: (failed) 状态:(失败)
Request URL: https://code.jquery.com/jquery-1.11.2.min.js 请求网址: https//code.jquery.com/jquery-1.11.2.min.js
Referrer Policy: no-referrer-when-downgrade 推荐人政策:降级时不推荐人

Request headers: 请求标头:
Referer: https://somePage.com/ 引荐来源: https//somePage.com/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36 用户代理:Mozilla / 5.0(Windows NT 10.0; Win64; x64)AppleWebKit / 537.36(KHTML,如Gecko)Chrome / 66.0.3359.139 Safari / 537.36

If I load the page https://code.jquery.com/jquery-1.11.2.min.js in the browser it works for second or the third attempt 如果我在浏览器中加载页面https://code.jquery.com/jquery-1.11.2.min.js ,则可以进行第二次或第三次尝试

I just put your CDN link both in the <head> of a file I'm working on, then tried as well at the bottom of the body and both worked. 我只是将您的CDN链接都放在我正在处理的文件的<head>中,然后在正文底部也进行了尝试,并且两者都起作用。 It's likely that something else in your <head> is breaking it. <head>其他内容可能正在破坏它。

If you use the same CDN in a basically empty project and just launch a single line of script like alert("it works!") does it pop up for you? 如果您在一个基本为空的项目中使用相同的CDN,并且只启动一行脚本,例如alert(“ it works!”),它会为您弹出吗? If so, your script tag and CDN are not the issue. 如果是这样,您的脚本标记和CDN不会成为问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM