Home | History | Annotate | Download | only in hosted

Lines Matching defs:JSON

2     http://www.JSON.org/json2.js
9 See http://www.JSON.org/js.html
19 This file creates a global JSON object containing two methods: stringify
22 JSON.stringify(value, replacer, space)
36 This method produces a JSON text from a JavaScript value.
73 Values that do not have JSON representations, such as undefined or
76 a replacer function to replace those with JSON values.
77 JSON.stringify(undefined) returns undefined.
89 text = JSON.stringify(['e', {pluribus: 'unum'}]);
93 text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
96 text = JSON.stringify([new Date()], function (key, value) {
103 JSON.parse(text, reviver)
104 This method parses a JSON text to produce an object or array.
118 myData = JSON.parse(text, function (key, value) {
131 myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
151 /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
159 // Create a JSON object only if one does not already exist. We create the
162 if (!this.JSON) {
163 this.JSON = {};
261 // JSON numbers must be finite. Encode non-finite numbers as null.
296 // for non-JSON values.
353 // If the JSON object does not yet have a stringify method, give it one.
355 if (typeof JSON.stringify !== 'function') {
356 JSON.stringify = function (value, replacer, space) {
359 // space parameter, and returns a JSON text. The replacer can be a function
389 throw new Error('JSON.stringify');
400 // If the JSON object does not yet have a parse method, give it one.
402 if (typeof JSON.parse !== 'function') {
403 JSON.parse = function (text, reviver) {
406 // a JavaScript value if the text is a valid JSON text.
445 // for non-JSON patterns. We are especially concerned with '()' and 'new'
451 // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
476 // If the text is not JSON parseable, then a SyntaxError is thrown.
478 throw new SyntaxError('JSON.parse');