goog.format.JsonPrettyPrinter
Classgoog.format.JsonPrettyPrinter(delimiters)
Formats a JSON object as a string, properly indented for display. Supports
displaying the string as text or html. Users can also specify their own
set of delimiters for different environments. For example, the JSON object:
{"a": 1, "b": {"c": null, "d": true, "e": [1, 2]}}
Will be displayed like this:
{
"a": 1,
"b": {
"c": null,
"d": true,
"e": [
1,
2
]
}
}
delimiters
{goog.format.JsonPrettyPrinter.TextDelimiters
}
goog.format.JsonPrettyPrinter.HtmlDelimiters
ClassA container for the delimiting characters used to display the JSON string
to an HTML <pre>
or <code>
element.
… more
goog.format.JsonPrettyPrinter.TextDelimiters
ClassA container for the delimiting characters used to display the JSON string to a text display. Each delimiter is a publicly accessible property of the object, which makes it easy to tweak delimiters to specific environments. … more
.format(json)
Formats a JSON object as a string, properly indented for display.
json
{*}
string
}