JSON

From Wikipedia, the free encyclopedia
Jump to: navigation, search

JSON (JavaScript Object Notation) is a way of expressing information.[1] JSON is usually easy to understand. It can express information like XML can. It is based on JavaScript's notation for object literals.[2] However, JSON is stricter.[2]

JSON and XML are both often used in AJAX.[3] Even though JSON is named after JavaScript, it can be used in other programming languages, such as Python.[4]

Example[change | change source]

This is an example of JSON:

{
     "firstName": "John",
     "lastName" : "Smith",
     "age"      : 25,
     "address"  :
     {
         "streetAddress": "21 2nd Street",
         "city"         : "New York",
         "state"        : "NY",
         "postalCode"   : "10021"
     },
     "phoneNumber":
     [
         {
           "type"  : "home",
           "number": "212 555-1234"
         },
         {
           "type"  : "fax",
           "number": "646 555-4567"
         }
     ]
 }

References[change | change source]

Other websites[change | change source]