JSON
From Wikipedia, the free encyclopedia
JSON (JavaScript Object Notation) is a way of expressing information.[1] JSON is usually easy to understand. It can express information like XML. It is based on JavaScript's notation for object literals.[2] However, JSON is stricter.[2]
JSON and XML are both often used in AJAX.[3] Even though JSON is named after JavaScript, it can be used in other programming languages, such as Python (PHP, etc.)[4]
Example[change | change source]
This is an example of JSON:
{
"firstName": "John",
"lastName" : "Smith",
"age" : 25,
"address" :
{
"streetAddress": "21 2nd Street",
"city" : "New York",
"state" : "NY",
"postalCode" : "10021"
},
"phoneNumber":
[
{
"type" : "",
"number": "212 555-1234"
},
{
"type" : "fax",
"number": "646 555-4567"
}
]
}
References[change | change source]
- ↑ "RFC 4627". Datatracker.ietf.org. 2011-10-26. http://datatracker.ietf.org/doc/rfc4627/?include_text=1. Retrieved 2011-10-31.
- ↑ 2.0 2.1 "JSON". JSON. http://www.json.org/. Retrieved 2011-10-31.
- ↑ "JSON Beats XML, or Ajaj vs Ajax". Ajaxonomy. 2010-12-07. http://ajaxonomy.com/2010/xml/json-beats-xml-or-ajaj-vs-ajax. Retrieved 2011-10-31.
- ↑ "18.2. json — JSON encoder and decoder — Python v2.7.2 documentation". Docs.python.org. http://docs.python.org/library/json.html. Retrieved 2011-10-31.