从数据对象arrary获取值
问题描述:
$.ajax({
url: postUrl,
type: 'GET',
dataType: 'json',
data: { "id": num },
contentType: "application/json; charset=utf-8",
success: function (data) {
$.each(data, function (id, allFollowers) {
result += 'Title : ' + data + '<br/>';
});
我的尝试:
我试过:data.allFollowers [0] .screeName,data [0] .allFollowers [0] .screeName ...
我可以在调试模式下看到这些值存在,但它返回一个空错误。?
What I have tried:
I've tried: data.allFollowers[0].screeName, data[0].allFollowers[0].screeName...
I can see these values exist here in debug mode, however it returns a null error..?
答
.ajax({
url: postUrl,
类型:'GET',
dataType:'json',
data:{id:num},
contentType:application / json; charset = utf -8,
成功:函数(数据){
.ajax({ url: postUrl, type: 'GET', dataType: 'json', data: { "id": num }, contentType: "application/json; charset=utf-8", success: function (data) {
.each(data,function(id,allFollowers){
结果+ ='标题:'+ 数据 +'< br />';
});
.each(data, function (id, allFollowers) { result += 'Title : ' + data + '<br/>'; });
我的尝试:
我试过:data.allFollowers [0] .screeName,data [0] .allFollowers [0] .screeName ...
I可以在调试模式下看到这些值存在,但是它返回一个空错误。?
What I have tried:
I've tried: data.allFollowers[0].screeName, data[0].allFollowers[0].screeName...
I can see these values exist here in debug mode, however it returns a null error..?