Home | History | Annotate | Download | only in resources

Lines Matching defs:JSON

2     http://www.JSON.org/json2.js
9 See http://www.JSON.org/js.html
11 This file creates a global JSON object containing two methods: stringify
14 JSON.stringify(value, replacer, space)
28 This method produces a JSON text from a JavaScript value.
65 Values that do not have JSON representations, such as undefined or
68 a replacer function to replace those with JSON values.
69 JSON.stringify(undefined) returns undefined.
81 text = JSON.stringify(['e', {pluribus: 'unum'}]);
85 text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
88 text = JSON.stringify([new Date()], function (key, value) {
95 JSON.parse(text, reviver)
96 This method parses a JSON text to produce an object or array.
110 myData = JSON.parse(text, function (key, value) {
123 myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
149 /*global JSON */
151 /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
158 // Create a JSON object only if one does not already exist. We create the
161 if (!this.JSON) {
162 JSON = {};
257 // JSON numbers must be finite. Encode non-finite numbers as null.
292 // for non-JSON values.
349 // If the JSON object does not yet have a stringify method, give it one.
351 if (typeof JSON.stringify !== 'function') {
352 JSON.stringify = function (value, replacer, space) {
355 // space parameter, and returns a JSON text. The replacer can be a function
385 throw new Error('JSON.stringify');
396 // If the JSON object does not yet have a parse method, give it one.
398 if (typeof JSON.parse !== 'function') {
399 JSON.parse = function (text, reviver) {
402 // a JavaScript value if the text is a valid JSON text.
441 // for non-JSON patterns. We are especially concerned with '()' and 'new'
447 // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
472 // If the text is not JSON parseable, then a SyntaxError is thrown.
474 throw new SyntaxError('JSON.parse');