Gets the string representation of the JSON object and encodes ampersands for use on the client.

This viper method also supports the extension viper syntax.


Smartsite SXML CopyCode image Copy Code
string this.getencoded()
string this.getencoded(boolean indent)
string this.getencoded(string name)
string this.getencoded(string name, boolean indent)

Extension Viper Syntax

Smartsite SXML CopyCode image Copy Code
string page.<id>.getencoded()
string page.<id>.getencoded(boolean indent)
string page.<id>.getencoded(string name)
string page.<id>.getencoded(string name, boolean indent)


Name Data Type Description
indent Boolean Indents the output for readability if set to true.
name String The name of the property. Use the . operator to query within nested objects.

Return Value

Data Type Description
String The JSON string representation of the object, with ampersands encoded

Used in

Macro Description
Json The JSON macro can parse a JSON string. It exposes properties to query the resulting object and methods to modify it.

Expand image Example