eval function (although this is no longer the preferred method). There are six supported data types:
Objects and arrays may be nested, and may each contain a mixture of data types within them. Strings may contain any Unicode character, except that double quotes, backslashes and control characters must be escaped. JSON is usually encoded as UTF-8. Whitespace is permitted, but should typically be removed unless the JSON is intended to be human-readable.
Common uses of JSON include AJAX (as a replacement for XML), remote procedure calls using JSON-RPC, and for communicating with NoSQL databases.
Untrusted JSON expressions should not be parsed using
JSON.stringify methods. Compatibility libraries such as JSON2 or JSON3 can be used to provide an implementation of this API in environments that do not already support it. Library support is similarly available in most other programming languages.
- JSON home page
- The JSON Data Interchange Format, ECMA-404, 1st Edition, October 2013
- JSON, Mozilla Developer Network