using post with custom variables

using post with custom variables

supermangosupermango Posts: 7Questions: 0Answers: 0
edited January 2010 in General
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.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    1. You are not using key/value pairs - which jQuery requires:
    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
This discussion has been closed.