Thursday, October 10, 2013

JSON Introduction

JSON is JavaScript Object Notation

The JSON format is used for serializing data between a Server and web application.

Example:

Create a capitals.json file with sample data.
 
{
 "capitals": [
  {
  "ap": "hyderabad",
  "tamilnadu": "chennai"  
  }
 ]
}


Use JQuery to fetch the JSON data and manipulate the data and display it on the screen

$(document).ready(function() {
      $('#element').click(function() {
        $.getJSON('capitals.json');
       --- add you code
      });
    });

No comments:

Post a Comment