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

159
Visualizações
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.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

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
    });
});
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