json.js
JSON utility functions.

File Location

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.Serializer.call()
No description.
code »
goog.json.isValid_(s)
Tests if a string is an invalid JSON string. This only ensures that we are not using any invalid characters
Arguments:
s :
The string to test.
Returns:   True if the input is a valid JSON string.
code »
goog.json.parse(s)
(Object | null)
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 | null)
  The object generated from the JSON string.
code »
goog.json.serialize(objectopt_replacer)
Serializes an object or a value to a JSON string.
Arguments:
object :
*
The object to serialize.
opt_replacer :
(function (this:Object, string, *): * | null | undefined)
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:   A JSON string representation of the input.
code »
goog.json.unsafeParse(s)
(Object | null)
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 :
The JSON string to parse.
Returns: 
(Object | null)
  The object generated from the JSON string.
code »

Global Properties

goog.json.Serializer.charToJsonCharCache_ :
(Object | null)
Character mappings used internally for goog.string.quote
Code »
goog.json.Serializer.charsToReplace_ :
(RegExp | null)
Regular expression used to match characters that need to be replaced. The S60 browser has a bug where unicode characters are not matched by regular expressions. The condition below detects such behaviour and adjusts the regular expression accordingly.
Code »

Directory json

File Reference