How to send all elements in DataTable to Server?
How to send all elements in DataTable to Server?
whitewizard
Posts: 12Questions: 0Answers: 0
I want to get all elements in my DataTable in json format and sent it to server when form submit.
I try this code..
$("#myForm").submit(function(){
var abc = "Haha";
var def = "Yoyo";
$.ajax({
type: "POST",
url: "./myAction.do?cmd=updateDB",
data: "abc="+ abc +"&def="+ def,
success: function(){
alert("Done");
}
});
return false;
});
Follow above code. It send some queryString to server that it's work, but i want to sent json (include all elements of datatable) to server and i want to know if i can send json to server then how server-side get the data. What should i do? please show example code. thanks.
Sorry for my english skill.
I try this code..
$("#myForm").submit(function(){
var abc = "Haha";
var def = "Yoyo";
$.ajax({
type: "POST",
url: "./myAction.do?cmd=updateDB",
data: "abc="+ abc +"&def="+ def,
success: function(){
alert("Done");
}
});
return false;
});
Follow above code. It send some queryString to server that it's work, but i want to sent json (include all elements of datatable) to server and i want to know if i can send json to server then how server-side get the data. What should i do? please show example code. thanks.
Sorry for my english skill.
This discussion has been closed.
Replies
Allan