I have been following various jQuery/Ajax threads on stackoverflow for refreshing tables without loading the entire page, however, it seems that this does not prevent the table from reloading itself. Is there any way to refresh only the table values, but keep the table from redrawing?
Resources I have been looking at-
How to refresh table contents in div using jquery/ajax
Redraw datatables after using ajax to refresh the table content?
More or less, I have a getTable.php page that displays my table, and nothing else: no headers, footers, etc.
PHP (getTable.php) - this is server side code (asp, html, etc..)
<?php
echo '<table><tr><td>TEST</td></tr></table>';
?>
Then, in my JS, I refresh the table by using the load() method:
HTML
<div id="tableHolder"></div>
JS
<script type="text/javascript">
$(document).ready(function(){
refreshTable();
});
function refreshTable(){
$('#tableHolder').load('getTable.php', function(){
setTimeout(refreshTable, 10000);
});
}
</script>
Every 10 seconds the entire table reloads. I understand it is because of the load, but how do I only update the values?