简体   繁体   English

由于adblock,Chrome中的Javascript Ajax请求失败,我有哪些选择?

[英]Javascript Ajax request fails in chrome because of adblock, what are my options?

I'm trying to run an ajax function 我正在尝试运行ajax函数

$.ajax({ url: etsyURL, dataType: 'jsonp', success: function(data) {

unfortunately in chrome on live it fails because of adblock 不幸的是,在Chrome直播中,由于adblock而失败

i'm using javascript/jquery because thats really all I know how to use, is there anyway to get around this issue? 我正在使用javascript / jquery,因为那真的是我所知道的全部使用方式,是否有解决此问题的方法?

You could set the "timeout" parameter on the ajax function to something like "5000". 您可以将ajax函数上的“超时”参数设置为“ 5000”之类的值。 If the url is not responding within 5 seconds, the error handler is called. 如果url在5秒钟内没有响应,则调用错误处理程序。

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

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