I am currently working on setting up a datatable and I need it to be displayed on the monitor in such a way that it can refresh the div and automatically paginate to the next page. However, whenever the div is refreshed, the auto-pagination gets cancelled and goes back to the first page. Any assistance would be greatly appreciated.
<script type="text/javascript">
$(document).ready(function() {
var table = $('.data').DataTable({
"searching": false,
"info": false,
"lengthChange": false
});
setInterval(function(){
var info = table.page.info();
var pageNum = (info.page < info.pages) ? info.page + 1 : 1;
table.page(pageNum).draw(false);
}, 5000);
});
$(document).ready(function() {
setInterval(function () {
$('#test').load(window.location.href + ' #test');
}, 3000);
});
</script>