Error net :: ERR_BLOCKED_BY_CLIENT when requesting Ajax

9

I came across a strange error when I tried to run an ajax request, and I was not very successful in finding solutions.

Here is the error:

Line199offorms.jsis$.ajax({in:

$.ajax({type:"POST",
    url: _url,
    cache: false,
    data: {
        type: 'excluir',
        key: _data
    },
    dataType: 'json',
    success: function(data) {
        //success
    }
});

PS: I've tried switching $ to jQuery but it did not work. PS. 2: References and calls from jQuery libraries are in the correct order.

The strangest thing is that this same file works to stop all other pages, since it is my global file for forms handling.

    
asked by anonymous 10.03.2014 / 21:06

4 answers

18

Well, I checked the in this link .

I tested it in firefox (and it worked). In fact, it was not code error or anything, it was just Adblock (chrome extension) blocking the request.

If someone has the same problem in the future, just add the domain ( even if it's localhost ) to the allowed list.

    
10.03.2014 / 22:30
0

Friend, use the following technique: link

This was to give access to local files. By default, Chrome blocks access to local files.

    
10.03.2014 / 23:48
0

The Avast extension blocks some analytics scripts (Google Analytics, for example) and social networks.

Just add the domains of the blocked scripts as an exception in the Avast extension settings so that it allows the execution of these scripts.

In addition AddBlock also blocks some features, as mend3 said in its response

a>,

    
13.11.2015 / 14:33
0

Just to help anyone who is seeing this answer: Adblock probably blocked this request because it had the word banner in the URL. Even if you pause adblock to develop, this AJAX might not work for some user using adblock (since it did not pause adblock on your site, and probably will not). My suggestion is to change the word banner from url to some other word.

    
29.06.2016 / 16:16