data
对象在每个对象中有2个对象,有多个数组。我想从第二个数组的第二个对象获取值。
$.ajax({
type: 'GET',
url: 'api/First.getUniStructure',
ContentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (data) {
debugger;
console.log(data);
var collage = data[0].collages[0].Name;
console.log(collage);
var oTable = $('#exampleTable').DataTable({
data: data,
columnDefs: [
{ targets: [2], data: data[0].collages[0].name }
],
columns: [
{ data: "ID" },
{ data: "Name" },
{ data: null }
]
});
}
});