Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!