| Country Rank: | 22 |
|---|---|
| World Rank: | 156 |
| Profile Viewed: | 1868 |
| Points: | 3828 |
|
15 Jan
2010
|
JSON (JavaScript Object Notation) |
JSON (JavaScript Object Notation) is a lightweight computer data interchange format. It is a text-based, human-readable format for representing objects and other data structures and is mainly used to transmit such structured data over a network connection (in a process called serialization). JSON finds its main application in Ajax web application programming, as a simple alternative to using XML for
asynchronously transmitting structured information between client and server. JSON stands for Javascript Object Notation.
JSON (JavaScript Object Notation) is a text format for the serialization of structured data.
JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays).
An object is an unordered collection of zero or more name/value pairs, where a name is a string and a value is a string, number, boolean, null, object, or array.
A JSON text is a serialized object or array. JSON-text = object / array
These are the six structural characters:
1) begin-array = [ left square bracket
2) begin-object = { left curly bracket
3) end-array = ] right square bracket
4) end-object = } right curly bracket
5) name-separator = : colon
6) value-separator = , comma
JSON Objects
An object structure is represented as a pair of curly brackets surrounding zero or more name/value pairs (or members). A name is a string. A single colon comes after each name, separating the name from the value. A single comma separates a value from a following name. The names within an object SHOULD be unique.
JSON Arrays
An array structure is represented as square brackets surrounding zero or more values (or elements). Elements are separated by commas.
JSON has been used to exchange data between applications written in all of these programming languages: ActionScript, C, C#, ColdFusion, Common Lisp, E, Erlang, Java, JavaScript, Lua, Objective CAML, Perl, PHP, Python, Rebol, Ruby, and Scheme.
JSON Structure Examples
This is a JSON object:
{
"Image": {
"Width": 800,
"Height": 600,
"Title": "View from 15th Floor",
"Thumbnail": {
"Url": "http://www.example.com/image/481989943",
"Height": 125,
"Width": "100"
},
"IDs": [116, 943, 234, 38793]
}
}
This is a JSON array containing two objects:
[
{
"precision": "zip",
"Latitude": 37.7668,
"Longitude": -122.3959,
"Address": "",
"City": "SAN FRANCISCO",
"State": "CA",
"Zip": "94107",
"Country": "US"
},
{
"precision": "zip",
"Latitude": 37.371991,
"Longitude": -122.026020,
"Address": "",
"City": "SUNNYVALE",
"State": "CA",
"Zip": "94085",
"Country": "US"
}
]
For More Information about JSON Structure, see RFC4627