Namespace goog.json
code »Classes
|
Show:
Type Definitions
JSON replacer, as defined in Section 15.12.3 of the ES5 spec.
JSON reviver, as defined in Section 15.12.2 of the ES5 spec.
Global Functions
code »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
boolean
Parameters |
---|
|
Returns |
|
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.
Object
Parameters |
---|
|
Returns |
|
Throws |
|
code »goog.json.serialize ( object, opt_replacer ) ⇒ string
Serializes an object or a value to a JSON string.
string
Parameters |
---|
|
Returns |
|
Throws |
|
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.
Object
Parameters |
---|
|
Returns |
|