Getting data from JSON with jQuery is really simple.
Example:
Here is a commented example of a simple script that appends div with data from JSON.You can do anything with that data for an example put it into a table, list or even generate rss feeds from it.Source code viewer
<script type="text/javascript"> // this gets JSON data from an url $.getJSON("/json-data-for-parsing", // this function gets called when data has been recieved function(data){ // parsing JSON data, line by line(like foreach) $.each(data, function(i,item){ // puts all titles in our div $("#test").append(item.title+"<br />"); }); }); </script> <div id="test"></div>Programming Language: Javascript
Parsing JSON:
JSON data is converted to object. If you have more complex JSON data and you don't know how objects work then you can find some help from: json.org - Parsing JSON in JavaScript.
JSON data is converted to object. If you have more complex JSON data and you don't know how objects work then you can find some help from: json.org - Parsing JSON in JavaScript.