Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 41 lines (28 sloc) 1.673 kB
11c7bdf @douglascrockford first commit
authored
1 JSON in JavaScript
2
3
4 Douglas Crockford
5 douglas@crockford.com
6
c98948a @douglascrockford remove json.js
authored
7 2015-05-03
11c7bdf @douglascrockford first commit
authored
8
9
10 JSON is a light-weight, language independent, data interchange format.
11 See http://www.JSON.org/
12
13 The files in this collection implement JSON encoders/decoders in JavaScript.
14
15 JSON became a built-in feature of JavaScript when the ECMAScript Programming
16 Language Standard - Fifth Edition was adopted by the ECMA General Assembly
5da6de9 @douglascrockford .js
authored
17 in December 2009. Most of the files in this collection are for applications
18 that are expected to run in obsolete web browsers. For most purposes, json2.js
11c7bdf @douglascrockford first commit
authored
19 is the best choice.
20
21
5da6de9 @douglascrockford .js
authored
22 json2.js: This file creates a JSON property in the global object, if there
11c7bdf @douglascrockford first commit
authored
23 isn't already one, setting its value to an object containing a stringify
24 method and a parse method. The parse method uses the eval method to do the
25 parsing, guarding it with several regular expressions to defend against
26 accidental code execution hazards. On current browsers, this file does nothing,
c07c287 @douglascrockford README
authored
27 preferring the built-in JSON object. There is no reason to use this file unless
28 fate compels you to support IE8, which is something that no one should ever
29 have to do again.
11c7bdf @douglascrockford first commit
authored
30
31 json_parse.js: This file contains an alternative JSON parse function that
32 uses recursive descent instead of eval.
33
5da6de9 @douglascrockford .js
authored
34 json_parse_state.js: This files contains an alternative JSON parse function that
11c7bdf @douglascrockford first commit
authored
35 uses a state machine instead of eval.
36
37 cycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle,
38 which make it possible to encode cyclical structures and dags in JSON, and to
c98948a @douglascrockford remove json.js
authored
39 then recover them. This is a capability that is not provided by ES5. JSONPath
40 is used to represent the links. [http://GOESSNER.net/articles/JsonPath/]
Something went wrong with that request. Please try again.