Alert Original Error Msg In AJAX
Alert Original Error Msg In AJAX
harrisonlee
Posts: 1Questions: 1Answers: 0
I have config as below:
$.fn.dataTable.ext.errMode = 'none';
$('#example')
.on( 'error.dt', function ( e, settings, techNote, message ) {
console.log(message);
} )
.DataTable();
The ajax result is
{
...
data: null,
error: 'Parameter Not Right'
...
}
However The message example is:
DataTables warning: table id=zdataTable - Parameter Not Right
My goal is to alert the original error mesage in ajax without "DataTables warning: table id=zdataTable -" profix. Is there any path to do that?
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
Answers
I'm afraid not - the prefix is always added. At the moment the only option would be to split the string on
;
(for example) in your error handling function and display the second half.Allan