JQuery $.each() JSON array object iteration JQuery $.each() JSON array object iteration json json

JQuery $.each() JSON array object iteration


Assign the second variable for the $.each function() as well, makes it lot easier as it'll provide you the data (so you won't have to work with the indicies).

$.each(json, function(arrayID,group) {            console.log('<a href="'+group.GROUP_ID+'">');    $.each(group.EVENTS, function(eventID,eventData) {            console.log('<p>'+eventData.SHORT_DESC+'</p>');     });});

Should print out everything you were trying in your question.

http://jsfiddle.net/niklasvh/hZsQS/

edit renamed the variables to make it bit easier to understand what is what.