javascript 如何修复 Chrome Developer Window 中的“pending”状态?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17423333/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to fix the “pending” status in Chrome Developer Window?
提问by Jean Louis
When I try to include social media scripts into my page, I get the "pending" status in Chrome on some computers (not all of them):
https://s17.postimg.cc/xvpjllmwv/image.png
当我尝试将社交媒体脚本包含到我的页面中时,我在某些计算机(并非所有计算机)上的 Chrome 中获得“待处理”状态:https:
//s17.postimg.cc/xvpjllmwv/image.png
In other words, the scripts are not loaded. The scripts are included via the default way as recommended by the developer's guide.
换句话说,不会加载脚本。这些脚本是通过开发人员指南推荐的默认方式包含的。
What settings of Chrome may cause such behavior?
Chrome 的哪些设置可能会导致此类行为?
回答by Jayram
This is due to the Ad-block or some plugin you are using with the chrome. Disabling the ad-block/plugin which blocks the requests will fix your issue. It blocks all the requests and so it is pending.
这是由于您在 chrome 中使用的 Ad-block 或某些插件。禁用阻止请求的广告块/插件将解决您的问题。它会阻止所有请求,因此它处于待处理状态。
Try to fix this way and share the status.
尝试以这种方式修复并共享状态。
回答by imekinox
Are you using HTTPS on the site?
您在网站上使用 HTTPS 吗?
If you are, chrome blocks http requests within https websites and shows a gray shield near the bookmark star on the url bar.
如果是,chrome 会阻止 https 网站内的 http 请求,并在 url 栏上的书签星标附近显示一个灰色盾牌。
If this is the case just include your external stuff without specifying protocols
如果是这种情况,只需包含您的外部内容而不指定协议
Example:
例子:
Change
改变
http://domain.com/some.jsto //domain.com/some.js
http://domain.com/some.js到 //domain.com/some.js
回答by Santiago Angel
Answer repeated from thisquestion.
从这个问题重复的答案。
I had the same issue on OSX Mavericks, it turned out that Sophos anti-virus was blocking certain requests, once I uninstalled it the issue went away.
我在 OSX Mavericks 上遇到了同样的问题,结果是 Sophos 防病毒软件阻止了某些请求,一旦我卸载它,问题就消失了。
You can also try disabling extensions in chrome to see if that helps, if so you'll know an extension is causing the problem. Use the '--disable-extensions flag to see if it fixes the problem.
您还可以尝试禁用 chrome 中的扩展程序,看看是否有帮助,如果有帮助,您就会知道是某个扩展程序导致了问题。使用 '--disable-extensions 标志来查看它是否解决了问题。
回答by Destiner
I was using AngularJS as a front-end framework for my app, and somehow $httpProvider.defaults.withCredentials = true;
made all my POST
requests pending. After I removed this line, everything run instantly.
我使用 AngularJS 作为我的应用程序的前端框架,并以某种方式$httpProvider.defaults.withCredentials = true;
使我的所有POST
请求都处于挂起状态。删除此行后,一切都会立即运行。
回答by Rastee
Sometimes the script takes more time in loading while the system has moved on. so make sure you wait for get to give you response before you manipulate it. so rather then doing following
有时,当系统继续运行时,脚本需要更多的时间来加载。因此,请确保在操作它之前等待 get 给出响应。所以而不是做以下
var temp;
$.get('path/to/filename.ext',function(data){
temp = data;
}
//use temp
do this
做这个
var temp;
$.get('path/to/filename.ext',function(data){
temp = data;
//use temp
}