TVB.json.parse
Object, Boolean
TVB.json.parse
(
jsonString
,
[customFormatter]
)
Parse a JSON string, returning the native JavaScript representation.
Only minor modifications from http://www.json.org/json.js.
- Parameters:
-
jsonString <String>A string containing JSON data -
[customFormatter] <Function>RESERVED FOR FUTURE USES function(k,v) passed each key value pair of object literals, allowing pruning or altering values
- Returns:
Object, Boolean - Javascript data built on JSON string
TVB.json.stringify
Object
TVB.json.stringify
(
data
,
[whitelist]
,
[depth]
)
Converts an arbitrary value to a JSON string representation.
Cyclical object or array references are replaced with null.
If a whitelist is provided, only matching object keys will be included.
If a depth limit is provided, objects and arrays at that depth will
be stringified as empty.
Uses YUI Library.
- Parameters:
-
data <Object>An object conaining all of the data -
[whitelist] <Array>Whitelist of acceptable object keys to include -
[depth] <Number>Depth limit to recurse objects/arrays (practical minimum 1)
- Returns:
Object - Javascript data built on JSON string