Acesso ao xmlHttPrequest em Datatables
function loadDataToTable(url,tableName){
var dataSet;
$.get(url), function(responseText) {
/*assuming the result is the JSON you need.
I'm skipping over all of the checks you would do*/
dataSet = JSON.Parse(responseText)
};
$("#"+tableName).DataTable( {
data: dataSet,
columns: [
{ title: "Col1" },
{ title: "Col2" },
{ title: "Col3" },
{ title: "Etc." }
]
} );
}
Bewildered Bison