ColdFusion 9.0 Resources |
ColdFusion.JSON.decodeDescriptionConverts a JSON-encoded string to a JavaScript variable. Function syntaxColdFusion.JSON.decode(string) See alsoColdFusion.JSON.encode, DeserializeJSON, SerializeJSON, Using Ajax Data and Development Features in the Developing ColdFusion Applications, http://www.json.org HistoryColdFusion 8: Added this function Parameters
ReturnsA Javascript variable containing the data in the JSON encoded string. UsageUse 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. If the JSON string has a security prefix as defined by the Server Settings > Settings page of the ColdFusion Administrator or specified in the cfapplication or cffunction tags, the function strips the prefix before decoding the string. ExampleThe following example uses the ColdFusion.JSON.decode and ColdFusion.JSON.encode functions When the user clicks the “Call” link, the callMe function encodes the String as JSON and calls the echo CFC’s plainEcho function with the result. The function also sets the return format to plain, so that the CFC function does not automatically convert its return value to JSON, and sends plain text instead. The echo.cfc component has two functions:
|