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

160
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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