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

87
Views
How to refresh multiple table with ajax

I am working on an appointment system. I want to update the "appointment requests" table and the "accepted appointments" table simultaneously when the "Confirm" button is clicked on the incoming appointment request. Currently, the "appointment requests" table is updated simultaneously, but I need to refresh the page to update my "accepted appointments" table.

function load_data(query) {

    var id = document.getElementById("personel_id").value;
    $.ajax({
        url: "includes/crm-clients-details-requests-load.php",
        method: "POST",
        data: {
            query: query,
            id: id
        },
        success: function(data) {
            $('#result-requests').html(data);
        }
    });

    $.ajax({
        url: "includes/crm-clients-details-confirmed-load.php",
        method: "POST",
        data: {
            query: query,
            id: id
        },
        success: function(data) {
            $('#result-confirmed').html(data);
        }
    });

    $.ajax({
        url: "includes/crm-clients-details-past-load.php",
        method: "POST",
        data: {
            query: query,
            id: id
        },
        success: function(data) {
            $('#result-past').html(data);
        }
    });
};

All ajax structures work alone without any problems, I want the second ajax build to run when the first ajax runs and is successful.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try code below

$.ajax({
    // options for the first call
}).done(function() {
    $.ajax({
        // options for the second call
    }).done(function () {
        // and so on
    });
});
about 4 years ago · Juan Pablo Isaza Report
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!