Getting GET values from fnServerData
Getting GET values from fnServerData
I'm completely new to JSON and so far I just can't get my head around this. This code works:
[code]
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( {"name": "table", "value": "mytable" });
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
});
}
[/code]
But I would like to replace "value" with a GET value, i e $_GET['table']. Any ideas??
Thanks in advance!!
[code]
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( {"name": "table", "value": "mytable" });
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
});
}
[/code]
But I would like to replace "value" with a GET value, i e $_GET['table']. Any ideas??
Thanks in advance!!
This discussion has been closed.
Replies
http://www.mathias-bank.de/2007/04/21/jquery-plugin-geturlparam-version-2/
And now:
[code]
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( {"name": "table", "value": $(document).getUrlParam("table") });
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
});
}
[/code]