JSON Tutorial

In this tutorial we will discuss on What is JSON?
JSON is known as JavaScript Object Notation. This is light weight and used for transferring the data from Client and Server and  vice versa. Format of the JSON was specified by Douglas Crockford.

JSON Tutorial

You can ask that XML also can perform the same functionality, then what is the use of JSON.

Though XML serves the same functionality, JSON has several advantages over XML. Below is the lost of features of JSON.

  • Light weight
  • Language Independent
  • Easy to understand
  • Human readable

Let’s have a look on the format of JSON.

var details = {
   "firstName" : "Pratik",
   "lastName" : "Mishra",
   "age" :  "28"
};

The file extension for the JSON file is .json and the internet media type is application /json.

Advantages of JSON:

  • One of the advantage of JSON is the Standard. JSON object has a standard structure that helps developer to read and understand easily.
  • Its is important to load the data quickly without page loading in Ajax application. Since JSON is light weight, it is easier to load the data without requesting the page load.
  • JSON is language Independent. So it can support most of the language like C++, Java, Perl, Python etc.
  • Web Services and APIs used JSON for sharing public data.

Sample example of JSON:

{
   "emp": [
	
      {
         "id":"123",
         "name": "Ram",
         "title": "Mr",
         "status": "B1"
      },
	
      {
         "id":"124",
         "name": "Hari",
         "title": "Mr",
         "status": "B2"
      }
   ]
}

Now we have got the clear picture on JSON tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *