Wednesday, July 20, 2011

jquery parse json multidimensional array - Stack Overflow

jquery parse json multidimensional array - Stack Overflow: "var json = {'forum':[{'id':'1','created':'2010-03-19 ','updated':'2010-03-19 ','user_id':'1','vanity':'gamers','displayname':'gamers','private':'0','description':'All things gaming','count_followers':'62','count_members':'0','count_messages':'5','count_badges':'0','top_badges':'','category_id':'5','logo':'gamers.jpeg','theme_id':'1'}]};

var forum = json.forum;

for (var i = 0; i < forum.length; i++) {
    var object = forum[i];
    for (property in object) {
        alert(property + '=' + object[property]); // This alerts 'id=1', 'created=2010-03-19', etc..
    }
}"