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);
})
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);
})