Read JSON data Using JQuery $.each() Example

Updated on     Kisan Patel

This post will show you how to parse JSON array using jQuery .each() function?

Here, we will use below JSON string to parse JSON using jQuery .each() function.

var articles = [
                  {
                      "title":"Title 1",
                      "url":"http://studyoverflow.com/title-1/",
                      "categories":"jQuery"
                  },
                  {
                      "title":"Title 2",
                      "url":"http://studyoverflow.com/title-2/",
                      "categories":"jQuery"
                  },
               ];

$.each iterates over articles in an JSON array, accessing both the current article and its index.

$.each(articles, function(index, obj) {
     alert(index + obj.title);
});

jQuery

Leave a Reply