JSON
JSONÂ stands for JavaScript Object Notation. It is defined on the site, http://www.json.org/. This is a textual notation in the same way as the object literals are defined in JavaScript . An object representation starts with the {
character and ends with the }
character. The text in between defines the fields of the objects in the form, string : value
. The string is the name of the field, and since JSON wants to be language agnostic, it allows any characters to be a part of the name of a field, and thus this string (as well as any string in JSON) should start and end with the "
characters.
Note
This may seem strange and, many times, when you start working with JSON, it is easy to forget and write { myObject : "has a string" }
instead of the correct { "myObject" : "has a string" }
notation.
Commas separate the fields. You can also have arrays in JSON. They start and end with [
and ]
characters, respectively, and they contain comma-separated values. The value in an object field or in an array...