The WddxSerializer object includes functions that serialize any JavaScript data structure. For more information on using this object, see Using WDDX in the Developing ColdFusion Applications.
Functions
The only function that developers typically call is serialize.
Function syntax |
Description |
---|---|
object.serialize(rootobj) |
Creates a WDDX packet for a passed WddxRecordset instance. |
object.serializeVariable(name, obj) |
Serializes a property of a structure. If an object is not a string, number, array, Boolean, or a date, WddxSerializer treats it as a structure. |
object.serializeValue(obj) |
Recursively serializes eligible data in a passed instance. |
object.write(str) |
Appends data to the serialized data stream. |
serialize
Description
Creates a WDDX packet for a passed WddxRecordset instance.
Syntax
object.serialize( rootobj ) |
Parameters
Parameter |
Description |
---|---|
object |
Instance name of the WddxSerializer object |
rootobj |
JavaScript data structure to serialize |
Return value
Returns a serialized WDDX packet as a string if the function succeeds, or a null value if an error occurs.
Usage
Call this function to serialize the data in a WddxRecordset instance.
Example
This example shows a JavaScript function that you can call to serialize a WddxRecordset instance. It copies serialized data to a form field for display: