JavascriptEncode

The JavascriptEncode() function encodes the given value to a Javascript literal.

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

Returns a text that contains a JavaScript literal. Returns null if the value is unknown.

Syntax

JavascriptEncode(value)

JavascriptEncode("\"Line 1\"\n'Line 2';") => "\"Line 1\"\n\'Line 2\';"

Parameters

Name
Type
Required
Description

value

any WEM value

☑️

see hint below

Value - any WEM value (strings, numbers, boolean, etc.). The following encoding is used for non-native JavaScript types:

  • Concept - the concept ID is used

  • Concept set - array of concept ID's is used

  • Duration - the number of ticks (milliseconds) is used

  • File - the URL as a string

  • Reference - string representation of the referenced list and rowID

Last updated