Access JSON response object
Access JSON response object
My JSON response has this structure.
[code]{
sEcho:1,
iTotalRecords:1300,
iTotalDisplayRecords:50,
aaData: [...] ,
sqlDataTables: "SELECT ... FROM ... WHERE ...."
}
[/code]
How can I acess the "sqlDataTables" variable in my Javascript code?
[code]{
sEcho:1,
iTotalRecords:1300,
iTotalDisplayRecords:50,
aaData: [...] ,
sqlDataTables: "SELECT ... FROM ... WHERE ...."
}
[/code]
How can I acess the "sqlDataTables" variable in my Javascript code?
This discussion has been closed.
Replies
The latter method is how my examples update the JSON return from the server:
[code]
$(document).ready( function () {
if ( $.fn.dataTableSettings.length >= 1 ) {
$('#example').dataTable().bind('xhr', function ( e, oSettings ) {
var n = document.getElementById('latest_xhr');
n.innerHTML = JSON.stringify(
JSON.parse(oSettings.jqXHR.responseText), null, 2
);
n.className = "brush: js;"
SyntaxHighlighter.highlight({}, n);
} );
}
} );
[/code]
Allan