Wddxserializer Object; Serialize; Serializevariable - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

562

WddxSerializer Object

The WddxSerializer object includes functions that serialize any JavaScript data
structure.
The only function that developers typically call is serialize.

serialize

Creates a WDDX packet for a passed WddxRecordset instance.
Syntax
object .serialize( rootobj )
object
Instance name of the WddxSerializer object.
rootobj
JavaScript data structure to be serialized.
Return
String. Returns the serialized WDDX packet if the function succeeds and a null value if
an error occurs.
value
Usage
Call this function to serialize the data in a WddxRecordset instance.
Example
This example illustrates a JavaScript function that you can call to serialize a
WddxRecordset instance. The function copies serialized data to a form field for display:
function serializeData(data, formField)
{
wddxSerializer = new WddxSerializer();
wddxPacket = wddxSerializer.serialize(data);
if (wddxPacket != null)
{
formField.value = wddxPacket;
}
else
{
alert("Couldn't serialize data");
}
}

serializeVariable

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.
Syntax
object .serializeVariable( name , obj )
CFML Language Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents