JSON

This is an old revision of this page, as edited by Charles Iliya Krempeaux (talk | contribs) at 08:01, 6 March 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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".