从数据对象arrary获取值 [英] Get values from data object arrary

查看:112
本文介绍了从数据对象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..?


这篇关于从数据对象arrary获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆