loop throught all members of an object in javascript
This question already has an answer here:
I have created a jsfiddle for you at http://jsfiddle.net/5eM4q/
The way you access the data using
data[obj].country
is incorrect
For the solution you can check out this demo.
DEMO
You can loop Object using for(k in obj)
for(k in obj){
var value = obj[k];
}
链接地址: http://www.djcxy.com/p/51998.html
上一篇: 阅读没有方括号的JSON数组