Web服务返回以下嵌套的JSON对象:印刷嵌套JSON不使用变量名
{"age":"21-24","gender":"Male","location":"San Francisco, CA","influencer score":"70-79","interests":{"Entertainment":{"Celebrities":{"Megan Fox":{},"Michael Jackson":{}},},"Social Networks & Online Communities":{"Web Personalization": {},"Journals & Personal Sites": {},},"Sports":{"Basketball":{}},},"education":"Completed Graduate School","occupation":"Professional/Technical","children":"No","household_income":"75k-100k","marital_status":"Single","home_owner_status":"Rent"}
我只是想通过这个对象没有指定属性名进行迭代,我想下面的代码:
for (var data in json_data) {
alert("Key:" + data + " Values:" + json_data[data]);
}
然而,如果它是一个嵌套值,它将打印值为[对象对象],是否有任何方法可以更深入地反复嵌套值?
typeof(someObject)返回“object”而不是“Object”...注意小写的“o” – 2010-11-05 21:05:48
好的。 :) 谢谢! – 2010-11-05 21:07:16