Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

356
Visualizações
ERR_BLOCKED_BY_CLIENT ajax function not working in chrome

When Adblock is active in chrome below script is not working in chrome. It shows error in console like this

jquery-1.7.2.min.js:4 GET http://example.com/advertisement/mult_select/30 net::ERR_BLOCKED_BY_CLIENT

jquery-1.7.2.min.js:4 POST http://example.com/advertisement/getCategoryFieldsList/30/0 net::ERR_BLOCKED_BY_CLIENT

I have tried also anti-adblock-killer.user.js. But still it is not working.

<script>
$(document).ready(function(event){
    
$('.category_1').live('change',function(){

var foo = []; 
var name = [];
$('.category_1 :selected').each(function(i, selected){ 
  foo[i] = $(selected).val(); 
  name[i] = $(selected).attr("myTag");
});

//$('.category_title_0').html(name[0]);
var str = (foo[0]).replace(/\,/g, '');
$(this).parent('div').nextUntil('#tit').remove();
var str2 = $(this).find('option:selected').attr('parent_id');
$.ajax({
url: "<?= site_url('advertisement/mult_select')?>"+'/'+str,
success:function(result)
{
$('.mul-select').append(result);
}
});
$.ajax({
    type: "POST",
    dataType: 'script',
    url: "<?= site_url('advertisement/getCategoryFieldsList') ?>"+"/"+str+"/"+str2,
    success: function(result)
    {
        if($("#"+str2).length > 0)
        {
            $("#"+str2).empty();
            $("#"+str2).nextAll('*').empty();
            $("#"+str2).html( result );
        }
        else
        {
        $('#dynamic_fields_div').append( "<div id="+str2+"></div>" );
        $("#"+str2).html( result );
        }
    } 
});

});

});
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

As mentioned in the comments, the issue is that adblock recognizes the word advertisement in the URL and it thinks it's an ad.
Many applications work this way (for example it happened to me that Kaspersky blocked a page on a site i own because it contained the words toss and ban) so you should be careful about the URL you write to take into account that visitors might have applications that block certain bad words.

over 4 years ago · Santiago Trujillo Relatório

0

In my case i didn't have the name "advertisement" on the url path, but still got the same ERR_BLOCKED_BY_CLIENT error.

I resolved it by giving cache: false option to the $.ajax() function.

I am leaving this comment here, as it may be useful to someone.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda