Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
Facing some problems with jQuery AJAX call configuration

I have an AJAX call that is loading data from a database. I have the following AJAX setup

$(function () {

    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    
    $(document).ajaxStart(function () {
        $("#placeholder").removeClass('d-none');
    });

    $(document).ajaxSuccess(function () {
        $("#placeholder").addClass('d-none');
    });

});

It's working pretty well until I use the input to search by word / letter. The input is using input event to be triggered but the problem is the following:

When I write something in the Input, the placeholders appear until it shows the results and then hide, but after that when I click outside the Input (remove the focus from the input), the placeholders appear for milliseconds and hide again (blink)

I've made a lot of test and the conclusion is that it's not happening because of the input event. Here is a thread (by me) for this problem.

Which jQuery event can I use to avoid input event trigger when click outside the input

What can cause this behaviour? I really need help.

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda