# JavaScript



# Functions

- **function-deserializejson** - Converts a JSON (JavaScript Object Notation) or JSON5 string data representation into CFML data, such as a struct or array.
- **function-encodeforjavascript** - Encodes the given string for safe output in JavaScript to reduce the risk of Cross Site Scripting attacks.
- **function-esapiencode** - Encodes the given string for safe output to reduce the risk of Cross Site Scripting attacks.
- **function-isjson** - Evaluates whether a string is in a valid JSON (JavaScript Object Notation) or JSON5 data interchange format.
- **function-jsstringformat** - Escapes special JavaScript characters, such as single quotation mark, double quotation mark, and newline
- **function-serializejson** - Converts CFML data into a JSON (JavaScript Object Notation) representation of the data.
- **function-toscript** - Creates a JavaScript expression that assigns the value of a variable to a JavaScript variable. This function can convert strings, numbers, arrays, structures, and queries to JavaScript syntax that defines equivalent variables and values.

# Methods

- **method-any-tojson** - Converts CFML data into a JSON (JavaScript Object Notation) representation of the data.
- **method-string-deserializejson** - Converts a JSON (JavaScript Object Notation) or JSON5 string data representation into CFML data, such as a struct or array.
- **method-string-encodeforjavascript** - Encodes the given string for safe output in JavaScript to reduce the risk of Cross Site Scripting attacks.


# Categories

[Ajax features](ajax.md)