OpenBD Wiki

From OpenBD
Jump to: navigation, search

SerializeJSON()

This function implements the core SerializeJSON() function, converting any CFML data object, including queries, to the JSON format for use within Javascript applications.

OpenBD has extended this function to remove an irritation with the case sensitivity of the resulting data names. This makes it easier to work with certain Javascript frameworks.

Contents

Parameters

SerializeJSON( data, serializeQueryByColumns [, lowercase] )

  • data: the CFML data to serialize
  • serializeQueryByColumns: a boolean flag to determine how you wish QUERY objects to be formatted (default: false)
  • lowercase: optional flag to set the case of all the names to lowercase (defaults to false)

Returns

This function returns a string representing the JSON version of the data passed in.

Notes

This function will output integers and doubles accordingly. For example, a variable representing 8, will be translated to 8, and not 8.0 as with other CFML engines.

See Also

DeSerializeJSON()

Engine Compatibility

  • OpenBD
  • BlueDragon
  • CF8

Personal tools