What is the JSON (JavaScript Object Notation) format?
- 19I typed "JSON" into Google and the first 4 hits where highly relevant.Paul Tomblin– Paul Tomblin2008-11-13 13:50:00 +00:00Commented Nov 13, 2008 at 13:50
- 9The question generates great answers though. Next time stackoverflow could be in one of those highly relevant top 4 hits on google.Mendelt– Mendelt2008-11-13 14:01:57 +00:00Commented Nov 13, 2008 at 14:01
- 5Lazy yes, but it seems like it's a legitimate item to be on here.Brian Knoblauch– Brian Knoblauch2008-11-13 14:06:16 +00:00Commented Nov 13, 2008 at 14:06
- 9Except that the best answer is actually just a cut-n-paste from one of those (more legitimate?) top-fours.Kev– Kev2008-11-13 14:07:01 +00:00Commented Nov 13, 2008 at 14:07
- 1I wrote the source at the end of the information. Most of answer of general question are cut and past. In this thread, I can see Wikipedia copy and past too ;) ...that's life.Patrick Desjardins– Patrick Desjardins2008-11-13 14:08:36 +00:00Commented Nov 13, 2008 at 14:08
6 Answers
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
Ref.: json.org
An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma).

(source: json.org)
An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).

(source: json.org)
A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.

(source: json.org)
A string is a collection of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.

(source: json.org)
A number is very much like a C or Java number, except that the octal and hexadecimal formats are not used. 
(source: json.org)
Here is an example:
{ "menu": { "id": "file", "value": "File", "popup": { "menuitem": [{ "onclick": "CreateNewDoc()" }, { "value": "Open", "onclick": "OpenDoc()" }, { "value": "Close", "onclick": "CloseDoc()" }] } } } And in XML the same thing would have been:
<menu id="file" value="File"> <popup> <menuitem value="New" onclick="CreateNewDoc()" /> <menuitem value="Open" onclick="OpenDoc()" /> <menuitem value="Close" onclick="CloseDoc()" /> </popup> </menu> Ref.: json.org
Hope you now get an idea of what is JSON.
1 Comment
From Wikipedia: JSON (Javascript object notation)
The JSON format is often used for transmitting structured data over a network connection in a process called serialization. Its main application is in Ajax web application programming, where it serves as an alternative to the use of the XML format.
1 Comment
The in-depth version seems to be well covered, maybe you're looking for the short-and-simplified version?
JSON is basically just a way to pass an array from one language to another.
It's used a lot for Ajax (amongst other things) because with Ajax you typically have a server-side language (PHP etc.) passing a set of results to a client-side language (javascript). Your javascript calls your PHP page with some parameters; your PHP page builds an array and echos it encodes it to JSON format; your javascript catches the JSON and decodes it back to an array to process.
There's more to it than that obviously (and for that reason I'm expecting a flurry of tear-streaked downvotes :) ), but that's all you need to get up and running with it.
Comments
It is JavaScript Object Notation. You can use it to send data back and forward. It is often recommended since there is not so much overhead, like the one you get with XML. This is why it has become more popular than XML with Ajax.
Take a look at this: http://en.wikipedia.org/wiki/JSON
Comments
In my opinion when one wants to access webservice of different service provider such as Twitter,facebook etc over HTTP.
Then one must create a url and request for connection .When connection established a large amount of data comes from requesting site .
Example
<7b226665 65644974 656d7322 3a5b7b22 63617465 676f7279 223a7b22 6e616d65 223a2254 72616e73 706f7274 6174696f 6e222c22 68656164 65725f69 636f6e22 3a225c2f 686f6d65 5c2f6164 6d696e5c 2f707562 6c69635f 68746d6c 5c2f7072 6f647563 74696f6e 2e6d6973 73696f6e 7a65726f 2e6f7267>
This DATA is too much difficult to understand and arbitary in nature so we have 2 option for the representation of arbitrary data structures either in JSON format or XML format .But disadvantage in XML , it is syntactically more complex and bigger in file size than JSON. So it is better to use JSON
2 Comments
JSON: JavaScript Object Notation.
JSON is a syntax for storing and exchanging data.
JSON is an easier-to-use alternative to XML.
JSON is a lightweight data-interchange format
JSON is language independent *
JSON is "self-describing" and easy to understand
EXAMPLE:
{"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ]}