Datatable ajax call
Datatable ajax call
saivathsow
Posts: 1Questions: 0Answers: 0
Hi,
I want to send the data(JSON) to my web application(java),but i m unable to send the data
i am sending data like this,
$('#tableName').dataTable( {
"destroy": true,
"processing": true,
"serverSide": true,
"ajax": {
"url": "actionName.action",
"contentType": "application/json",
"type": "POST",
"data": function ( d ) {
d.jsonData =json1;
return d;
}
},
"ordering": false,
"bFilter": false,
} );
json1 is my json data ,i m fetching the data in my web application with the name jsonData but getting null.Can you please help me reagrding how to send that data to my web application ,how to fetch the data in my web application(java) ,
This discussion has been closed.
Replies
Hi @saivathsow ,
If you look at the examples for
ajax.data
, you don't needreturn d
.If
jsonData
is null on the server end, is it null at the point of sending? it would be worth adding some debug on line 11. Also, is json1 valid JSON? If not, useJSON.stringify()
Hope that helps,
Cheers,
Colin