Namespace JSON
JSON namespace
Defined in: json.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
JSON.parse(text, reviver)
Takes a text and an optional reviver function, and returns a JavaScript value if the text is a valid JSON text.
|
| <static> |
JSON.stringify(value, replacer, space)
Takes a value and an optional replacer, and an optional space parameter, and returns a JSON text.
|
Method Detail
Takes a text and an optional reviver function, and returns a JavaScript value if the text is a valid JSON text.
- Parameters:
- {String} text
- the JSON string to parse
- {Function} reviver Optional
- Function to call on each object of the resulting object to transform values. The Function will be called with three arguments - the propertys' "parent", the property name and the property value
<static>
{String}
JSON.stringify(value, replacer, space)
Takes a value and an optional replacer, and an optional space parameter, and returns a JSON text.
- Parameters:
- {Mixed} value
- the object to be stringified
- {Function|String[]} replacer Optional
- Function to replace values or an Array to idenfity the properties to keep.
- {Number|String} space Optional
- Number of space characters or actual String to use for indentation
- Returns:
- {String} JSON String
- See: