Parse JSON data using jQuery.getJSON()

In this post I am going to explain, how we can parse a JSON data which we will get here using one of the jQuery Ajax shorthand method$.getJSON(). Basically, the $.getJSON() method loads the JSON-encoded data from the server using a GET HTTP request based on a URL to which the request is sent. It also has a callback function which is executed if the request succeeds. The returned data passed to the callback function is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. So, we don’t need to worry about if the data returned from the server is an integer, string or else, since it’s always a JSON-encoded data.

Continue reading