{
"info": {
    "limit": "0",
    "xdata": {
        "hospital": {
            "name": "qwewe",
            "street": "cxcxc"
        },
        "factory": {
            "name": "wrwr",
            "street": "xzcc"
        },
        "industry": {
            "name": "lll",
            "street": "sdfdsfdf"
        }
    }
    }


如何打印xdata的内容?即我想要医院,工厂和行业的数据
我正在使用$.each jQuery循环,但无法将详细信息送往医院。

最佳答案

再试下

xdata = your_data.info.xdata;

for (xd in xdata) {
  console.log('Name: ' + xdata[xd].name);
  console.log('Street: ' + xdata[xd].street);
}

07-27 13:45