Javascript 如何检测/处理JQuery1.x客户端阻止的net::ERR\u?
我正在尝试使用以下简单脚本检测内容阻止程序(广告阻止扩展、基于主机的块、基于代理的块):Javascript 如何检测/处理JQuery1.x客户端阻止的net::ERR\u?,javascript,jquery,Javascript,Jquery,我正在尝试使用以下简单脚本检测内容阻止程序(广告阻止扩展、基于主机的块、基于代理的块): try { $.ajax({ url: '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', dataType: 'jsonp', error: function( jqXHR, textStatus, errorThrown ) { alert(jqXHR.st
try {
$.ajax({
url: '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
dataType: 'jsonp',
error: function( jqXHR, textStatus, errorThrown ) {
alert(jqXHR.status);
},
always: function( jqXHR, textStatus, errorThrown ) {
alert("always handler fired");
}
});
} catch(ex) {
alert("ex cought");
}
,但是(请访问启用adblock扩展的两个示例)
我的应用程序被jQuery 1.11.0卡住了,无法升级。用jQuery 1.11.0捕获net::ERR\u被客户端阻止\u
有什么想法吗
注意:我既不能依赖于
adsbygoogle.loaded
,也不能依赖于检查横幅的可见性,即使使用jquery 3.0,我也看不出如何让net::ERR\u被客户端阻止。请尝试使用jquery 1.$。get(“”).then(function(){//success,no-adblock}),function(jqXHR,textStatus,errorshown){//failed-adblock或跨域请求})