var Table;
var Set;
function mainTable(){
Table = "";
Set = "";
$.ajax({
"url": "MyURL",
"type" : "POST",
"success": function(json) {
alert(JSON.stringify(json));
var tableHeaders;
$.each(json.columns, function(i, val){
tableHeaders += "<th>" + val + "</th>";
});
$("#Table").empty();
Set = json.data;
Table = $('#myTable').DataTable({
'responsive': true,
'scrollX': true,
'scrollY': '350px',
'data': Set,
'order': [1, 'asc']
});
},
"dataType": "json"
});
}
My json response is fine, but it is giving e[i] is undefined error ? Not able to solve this