Server Side Question. How do I send POST variables to the Ajax page?
Server Side Question. How do I send POST variables to the Ajax page?
SkyScream
Posts: 22Questions: 1Answers: 0
$(document).ready(function() {
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"ajax": "../server_side/scripts/server_processing.php"
} );
} );
in this code, how would i set it up to pass post variables in?
This discussion has been closed.
Answers
This is an example of a extra parameter user_id being passed in. Your
ajax
property needs to be turned into a object instead of a string and the url moves into theurl
property.The Docs have more examples
The
ajax
object also has a "type":"post" if you want to do a post instead of a get.ah thank you. I figured that out. Now I have another problem I posted. Do you think you can help me out with it?
http://datatables.net/forums/discussion/25520/okay-i-m-trying-to-get-this-to-work-server-side-with-what-i-have-help
if I use this method :
"data": {
"user_id": 451
}
will the data on the server side be retrivable by $_POST["user_id"]
?
I have this:
and i have input fields bellow, in the HTML.
Am I missing something?
those input fields aren't being passed to the serverside page as POST data.