Get the data received via ajax request
Get the data received via ajax request
rrkumar
Posts: 4Questions: 1Answers: 0
Hi,
I need to get the data that was returned for the request made by data tables to get ajax sourced data.
I looked through the DOM and through the example but could not figure it out.
Can some one please tell me how can I get, the data that was received using the following piece of code?
$('#example').dataTable( {
"ajax": '../ajax/data/arrays.txt'
} );
Thanks.
This discussion has been closed.
Answers
Thanks everyone. I got the answer. Here it is in case someone needs it in future.
$('#example').dataTable( {
"ajax": '../ajax/data/arrays.txt',
"initComplete": function( settings, json ) {
console.log(json);
} } );
Exactly that -
initComplete
is the way to do it. You can also useajax.json()
after the data has been loaded if you need it in future.Allan
Thanks allan.