a web service returns the following nested json object:
{"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"}
i just want to iterate through this object without specifying property name, i tried the following code :
for (var data in json_data) {
alert("Key:" + data + " Values:" + json_data[data]);
}
however it prints value as [object Object] if it's a nested value, is there any way to keep iterating deeper into nested values ?