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

88
Views
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
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!