toScript

Creates a JavaScript or ActionScript expression that
assigns the value of a ColdFusion variable to a JavaScript
or ActionScript variable. This function can convert
ColdFusion strings, numbers, arrays, structures, and
queries to JavaScript or ActionScript syntax that defines
equivalent variables and values.

toScript(cfvar, javascriptvar [, outputformat] [, asformat]) → returns string

toScript Argument Reference

cfvar any
Required

A ColdFusion variable. This can contain one of the following:
String, Number, Array, Structure or Query.

javascriptvar string
Required

A string that specifies the name of the JavaScript variable
that the toScript function creates.

outputformat boolean
Default: true

A Boolean value that determines whether to create
WDDX (JavaScript) or ActionScript style output for
structures and queries.
Default: true
Values:
  • true
  • false

asformat boolean
Default: false

A Boolean value that specifies whether to use
ActionScript shortcuts in the script.
Default: false
Values:
  • true
  • false

Fork me on GitHub