I have a data table and using ajax to fetch data and display on my html DOM page. But the problem is after implement the server-side processing for the data table I finally have records in my html table through ajax but when I make a change in my database the change is not getting reflected in my data table until and unless I refresh the page. Then what's the benifit of using ajax in data table that you still have to refresh the page to see the changes
My ajax code to select the data
$(document).ready(function() {
$('#example').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "rendringMain.php"
} );
My rendringMain.php is exectly the same like this link https://datatables.net/examples/server_side/simple.html but few changes
You can use following solution to refresh your datatable at every 5 seconds:
window.setInterval(
$("table[id='example']").DataTable().ajax.reload();
, 5000);