Description

Converts a JavaScript expression to a JSON-encoded string.

Function syntax

ColdFusion.JSON.encode(expression)

See also

ColdFusion.JSON.decodeDeserializeJSONSerializeJSONUsing Ajax Data and Development Features in the Developing ColdFusion Applicationshttp://www.json.org

History

ColdFusion 8: Added this function

Parameters

Parameter

Description

name

An expression with the data to encode.

Returns

A String containing the data in JSON encoded format.

Usage

Use this function when you must explicitly convert between JavaScript and JSON format, for example, when you must call a remote function that is not in a CFC.

Example

See the example in ColdFusion.JSON.decode.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy