JSON
From Just Solve the File Format Problem
(Difference between revisions)
Dan Tobias (Talk | contribs) |
Dan Tobias (Talk | contribs) |
||
Line 7: | Line 7: | ||
'''JavaScript Object Notation''' (JSON) is widely used by web applications to communicate between a web page front end and a server back end. | '''JavaScript Object Notation''' (JSON) is widely used by web applications to communicate between a web page front end and a server back end. | ||
+ | |||
+ | JSON is a very simply-defined format for representing data in text-based form using a few simple types, including two "compound types" which can be nested: | ||
+ | |||
+ | * '''number''': A decimal number, optionally including a decimal point or exponential notation. Leading zeroes are not allowed unless the only number before the decimal point is a single zero, or the number is equal to zero. | ||
+ | |||
+ | * '''string''': A string of ([[Unicode]]) characters surrounded by double quotes. The only characters not allowed directly (without escaping) are double quotes, backslashes, or control characters; a backslash can be used to precede a quote or backslash used as a character within the string, as well as \b for backspace, \f for formfeed, \n for newline, \r for carriage return, \t for tab, and \u followed by 4 hexadecimal digits for encoding any Unicode character in the 0000-FFFF range. | ||
+ | |||
+ | * ''true'', ''false'', or ''nil'' are permitted as typeless values. | ||
+ | |||
+ | * '''object''': An associative array consisting of names and values, where the name and value are separated by a colon (:), the name/value pairs are separated by commas, and the whole object is surrounded by curly braces {}. The name is a (double-quoted) string, and the value can be any of the data types in JSON including another object. There is no inherent ordering to the values of an object. | ||
+ | |||
+ | * '''array''': An ordered collection of values, which can each be any of the JSON data types, and are separated by commas and surrounded by square brackets []. | ||
== Links == | == Links == | ||
− | * [http://www.json.org/ | + | * [http://www.json.org/ Official website] |
* [http://pro.jsonlint.com/ Linter/Validator] | * [http://pro.jsonlint.com/ Linter/Validator] |
Revision as of 13:40, 31 January 2013
JavaScript Object Notation (JSON) is widely used by web applications to communicate between a web page front end and a server back end.
JSON is a very simply-defined format for representing data in text-based form using a few simple types, including two "compound types" which can be nested:
- number: A decimal number, optionally including a decimal point or exponential notation. Leading zeroes are not allowed unless the only number before the decimal point is a single zero, or the number is equal to zero.
- string: A string of (Unicode) characters surrounded by double quotes. The only characters not allowed directly (without escaping) are double quotes, backslashes, or control characters; a backslash can be used to precede a quote or backslash used as a character within the string, as well as \b for backspace, \f for formfeed, \n for newline, \r for carriage return, \t for tab, and \u followed by 4 hexadecimal digits for encoding any Unicode character in the 0000-FFFF range.
- true, false, or nil are permitted as typeless values.
- object: An associative array consisting of names and values, where the name and value are separated by a colon (:), the name/value pairs are separated by commas, and the whole object is surrounded by curly braces {}. The name is a (double-quoted) string, and the value can be any of the data types in JSON including another object. There is no inherent ordering to the values of an object.
- array: An ordered collection of values, which can each be any of the JSON data types, and are separated by commas and surrounded by square brackets [].