using post with custom variables
using post with custom variables
supermango
Posts: 7Questions: 0Answers: 0
okay, before i begin... let me state that i'm completely lost in this ajax/jquery mess.
from some examples, this is what i've put together:
[code]
$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "myphpscript.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "classnumbers": "1",
"courserequests": "1",
"copies": "0",
"deletes": "0",
"allsemesters": "1",
"semester": "ALL",
"year": "ALL",
"completed": "0",
"url": "url",
"rememberurl": "rememberurl" } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
} } );
[/code]
1) What is wrong with this code?
2) How do I make it a POST request? I looked at this thread (http://datatables.net/forums/comments.php?DiscussionID=88) and I became cross-eyed in the process.
from some examples, this is what i've put together:
[code]
$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "myphpscript.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "classnumbers": "1",
"courserequests": "1",
"copies": "0",
"deletes": "0",
"allsemesters": "1",
"semester": "ALL",
"year": "ALL",
"completed": "0",
"url": "url",
"rememberurl": "rememberurl" } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
} } );
[/code]
1) What is wrong with this code?
2) How do I make it a POST request? I looked at this thread (http://datatables.net/forums/comments.php?DiscussionID=88) and I became cross-eyed in the process.
This discussion has been closed.
Replies
http://datatables.net/examples/server_side/custom_vars.html
http://api.jquery.com/jQuery.ajax
2. Follow this example: http://datatables.net/examples/server_side/post.html
Regards,
Allan