विश्व का सबसे बड़ा हिंदी वेब डेवलपर साइट

JSON Tutorial


JSON: JavaScript Object Notation.

JSON is a syntax for storing and exchanging data.

JSON is an easier-to-use alternative to XML.

The following JSON example defines an employees object, with an array of 3 employee records:

JSON Example

    {"firstName":"John", "lastName":"Doe"},
    {"firstName":"Anna", "lastName":"Smith"},
    {"firstName":"Peter", "lastName":"Jones"}

The following XML example also defines an employees object with 3 employee records:

XML Example

        <firstName>John</firstName> <lastName>Doe</lastName>
        <firstName>Anna</firstName> <lastName>Smith</lastName>
        <firstName>Peter</firstName> <lastName>Jones</lastName>

What is JSON?

  • JSON stands for JavaScript Object Notation
  • JSON is a lightweight data-interchange format
  • JSON is language independent *
  • JSON is "self-describing" and easy to understand
Note * JSON uses JavaScript syntax, but the JSON format is text only, just like XML.
Text can be read and used as a data format by any programming language.