Bs_Wddx.class.js Basic transformer from any Javascript type to WDDX-format and back. Used mainly for js-rs: Passing data from js-code to the server script (written in PHP in my case) and back to the script.
[line 39]
Bs_Wddx.class.js Basic transformer from any Javascript type to WDDX-format and back. Used mainly for js-rs: Passing data from js-code to the server script (written in PHP in my case) and back to the script.
Usage Sample: var jsVar = new Object(); // Take any random Object jsVar.anArray = new Array(1,2,"hallo!", "<hallo>!");
var wddx = new Bs_Wddx(); // Create the WDDX-handler instance var wddxXml = wddx.serialize(jsVar); // Serialize the JS-variable // Transfer the WDDX data to where you want var tmp = wddx.serialize(wddxXml); // Deserialize the wddx-XML data back to the JS-variable
INFO: PHP Object Support
Object hadling in WDDX is very poorly and inconsistently supported (Found that out *after* implementation :-( ).
If you pass a WDDX-js-objects it will convert to a simple PHP-hash array. This is usually fully sufficient;
If you want PHP to instanciate a PHP-object you *must* add a attribute name called 'php_class_name' to the js-object
and set it to the PHP class name you wish to instanceiate. PHP will then try to create that class.
I recomend to live without this feature.
INFO: Js Object Support When deserializing:
If you want specific js-object to be instanciated from the WDDX data, then the class name musst be given in
the 'type' of the WDDX <struct>-tag. E.g. <struct type='MyClassName'>...</struct>. Unfortunately PHP's WDDX
does *not* support this feature. I recomend to live without this feature.
NOTE:
WDDX extion 'recordset', 'binary' and timezone are not supported (yet?)
Tags:
access:
public
version:
4.0.$Id: Bs_Wddx.class.js,v 1.3 2003/09/15 15:02:13 andrej Exp $