JavaScriptEncode method (text)

Encodes this text as a JavaScript string.

Syntax

text.JavaScriptEncode

Returns the value of text encoded as a JavaScript string.

The returned text is flagged as safe as it has already been HTML-encoded.

Example

{% Var text = "These are for Julie's order" %}

{{ text.JavaScriptEncode }}

The above example would output: These are for Julie\u0027s order