最近我意识到,一些adblocker扩展(例如adBlocker plus)阻止了一些Ajax调用.我在控制台上遇到了这个错误:
GET http://localhost/prj/conn.php?q=users/list/ net::ERR_BLOCKED_BY_CLIENT
Run Code Online (Sandbox Code Playgroud)
为什么它会阻止某些Ajax调用而不是其他调用,以及导致这种情况的原因 除了告诉用户关闭adblocker之外,还有其他解决方法吗?
我使用的是此处提供的相同代码
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
console.log('got here');
FB.init({
appId : '197112467099018', // App ID
channelUrl : '//WWW.MYDOMAIN.COM/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id …Run Code Online (Sandbox Code Playgroud)