I am returning an object to my view using $.getJSON. The object contains a number of Lists, that I need to iterate over. How can this be done? My code so far is:
$.getJSON("/Home/GetData",
function (data) {
$.each(data, function (index) {
//access data here for each list in object?
});
});
Thanks.
If I understand what you’re asking here, you’re getting back JSON object of this form:
You should first iterate over your returned JSON object and then iterate over each list’s items individually. Something along these lines: