Laravel 8 Datatables Keeping Selected Page Number

$('#example').dataTable( {
stateSave: true,
stateDuration:-1
} );
$('#example').dataTable( {
"stateSave": true,
"stateDuration": 60 * 60 * 24
});
$('#example').dataTable( {
stateSave: true,
stateSaveCallback: function(settings,data) {
localStorage.setItem( 'DataTables_' + settings.sInstance, JSON.stringify(data) )
},
stateLoadCallback: function(settings) {
return JSON.parse( localStorage.getItem( 'DataTables_' + settings.sInstance ) )
}
} );
table.row(index).data(data).draw(false)
var table = $("#table").DataTable();
table.ajax.reload(null, false);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store