var obj={"name":"wjy","age":26,"sex":"female"};//定义一个object对象var keys=[];//定义一个数组用来接受keyvar values=[];//定义一个数组用来接受value for(var key in obj){ keys.push(key); values.push(obj[key]);//取得value alert(eval("obj."+key));//循环内逐一打印value值 }alert(obj.name);//wjyalert("keys is :"+keys+" and values is :"+values);//keys is : name,age,sex and values is : wjy,26,female
1 for (var i in data.data_info) { 2 console.log(data.data_info[i]);3 console.log(i);4 };