Creates a WDDX packet for a passed WddxRecordset instance.
object.serialize( rootobj )
Parameter |
Description |
---|---|
object |
Instance name of the WddxSerializer object |
rootobj |
JavaScript data structure to serialize |
Returns a serialized WDDX packet as a string if the function succeeds, or a null value if an error occurs.
Call this function to serialize the data in a WddxRecordset instance.
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:
function serializeData(data, formField) { wddxSerializer = new WddxSerializer(); wddxPacket = wddxSerializer.serialize(data); if (wddxPacket != null) { formField.value = wddxPacket; } else { alert("Couldn't serialize data"); } }