Json对象遍历

var json = {"id":"123","name":"tom","sex":"male"};

1.for循环遍历
for(var key in json){
    alert(key+":"+json[key]);
 }

2.利用jQuery遍历

$.each(json ,function(idx,item){    
    alert(item.id+"——"+item.name);
})

原文地址:https://www.cnblogs.com/pengyan5945/p/5218325.html