JSON

This is an old revision of this page, as edited by Minghong (talk | contribs) at 08:05, 6 March 2005 (Typo correction). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

JSON, which stands for "JavaScript object notation", is a lightweight data interchange format.

JSON and JavaScript

Unlike many object-oriented programming languages, JavaScript objects do not necessarily have to be created by a constructor. JavaScript objects can be created by an object literal format. For example:

   my_object =
   { "name"     : "Joe Blow"
   , "address"  : "123 Somewhere Street"
   , "city"     : "Surrey"
   , "province" : "BC"
   , "country"  : "Canada"
   };

This produces a JavaScript object named "my_object" with fields: "name", "address", "city", "province", and "country". One could use this object as follows:

   document.write("My name is "+my_object.name+".\n");
   document.write("And I live on "+my_object.address+" in "+my_object.city+".\n");

Which would print out:

   My name is Joe Blow.
   And I live on 123 Somewhere Street in Surrey.

JSON is a JavaScript object literal.


JSON Pronunciation

JSON is pronounced like the name "Jason".