json.js
No description.

File Location

/goog/json/json.js

Classes

goog.json.Serializer
Class that is used to serialize JSON objects to a string.

Public Protected Private

Global Functions

goog.json.isValid_(s) boolean
Tests if a string is an invalid JSON string. This only ensures that we are not using any invalid characters
Arguments:
s : string
The string to test.
Returns: boolean  True if the input is a valid JSON string.
code »
goog.json.parse(s) Object
Parses a JSON string and returns the result. This throws an exception if the string is an invalid JSON string. Note that this is very slow on large strings. If you trust the source of the string then you should use unsafeParse instead.
Arguments:
s : *
The JSON string to parse.
Returns: Object  The object generated from the JSON string, or null.
code »
goog.json.serialize(objectopt_replacer) string
Serializes an object or a value to a JSON string.
Arguments:
object : *
The object to serialize.
opt_replacer : ?goog.json.Replacer=
A replacer function called for each (key, value) pair that determines how the value should be serialized. By defult, this just returns the value and allows default serialization to kick in.
Returns: string  A JSON string representation of the input.
code »
goog.json.unsafeParse(s) Object
Parses a JSON string and returns the result. This uses eval so it is open to security issues and it should only be used if you trust the source.
Arguments:
s : string
The JSON string to parse.
Returns: Object  The object generated from the JSON string.
code »

Directory json

File Reference