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

95
Vistas
Refresh table only when modal closes

I have a script that reloads the entire page when modal is closed, I want it to reload just the div that contains the table instead of the entire page.

the div is:

<div class="result_data" id="result_data"> Table here </div>
<script>
$(document).ready(function(){
    // use ajax, call the PHP
    $.ajax({
        url: 'pages/t-log.php', // path of lelong
        success: function(response){
            $('#result_data').html(response);
        }
    })
});
</script>

My code is:

    <script>
$('#modal-buy, #modal-sell').on('hidden.bs.modal', function () { 
    location.reload();
});
    </script>

I was able to do it using:

$('#modal-buy, #modal-sell').on('hidden.bs.modal', function () { 
    $('#result_data').load(document.URL +  ' #result_data');
    //location.reload();
});

but the new challenge is that the ID is already being used to populate the table, so it reloads but doesn't populate the table.

about 4 years ago · Juan Pablo Isaza
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