jhyland87 / DataTables-Live-Ajax

Keep an AJAX sourced DataTable up to date, without reloading the entire table at once (with custom interval and pausing ability)
http://www.linuxdigest.org/misc/script_examples/DataTables-Live-Ajax/examples/
MIT License
18 stars 8 forks source link

Disable Error Alert #4

Open alfonsrv opened 3 years ago

alfonsrv commented 3 years ago

First off – awesome Javascript plugin; not sure why this hasn't gained more traction back in the days. Probably because less people use DataTables with Editor.

Anyways, is there a method to prevent the alert window from appearing when an error occurs and overwrite the functionality? I tried using the xhrErr.liveAjax, but couldn't manage to disable the default behavior.

jeankassio commented 2 years ago

I also don't understand how it was abandoned, I still use it in my projects. But I'll take the opportunity to answer your question, good that I take questions from those who stop by to see:

$.fn.dataTable.ext.errMode = 'none';

$('#example').on( 'error.dt', function ( e, settings, techNote, message ) {
console.log( 'An error has been reported by DataTables: ', message );
} ) .DataTable();
$('#example').DataTable();