I need your help in refreshing the div="table" which it has a table that is retrieving its rows from the database.
<div id="table">
<h1 id="Requests">
<table></table>
</h1>
</div>
<button id="refresh-btn">Refresh Table</button>
I tried to use the below jquery, however it is refreshing the div without picking up the updates from the database.
<script>
$(document).ready(function() {
function RefreshTable() {
$( "#table" ).load( "requests.html #table" );
}
$("#refresh-btn").on("click", RefreshTable);
});
</script>
答案 0 :(得分:0)
Delete table
<script>
$(document).ready(function() {
function RefreshTable() {
table.innerHTML = '';
$( "#table" ).load( "requests.html #table" );
}
$("#refresh-btn").on("click", RefreshTable);
});