Re: __data__ object
Alex Russell <[email protected]>
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Organization | burstlib.org |
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday 07 September 2003 9:42 am, Christian Boulanger wrote:
> Hi Alex,
>
> I am thinking about whether I should write a PHP function which
> supplies the required markup'd code to __data__ or just send
> javascript. I wonder about perfomance and what the advantages are
> to convert an array into the markup code. I would think that
> javascript is probably a lot faster since it does not need any
> parsing.
This is true, and the primary reason that the combo-box widget
supports both types of data retreival. What you choose should be a
function of your comfort level with each approach and how much data
you are transfering.
With the combo-box we had a data-size target on the order of hundreds
of kilobytes, and parsing via the DOM was just too slow. For smaller
data sets (tens of rows), the overhead is negligable and will be
dwarfed by network latency in the common case.
> Since data does not need to be degradable (as widgets) -
> what would be the advantage to send the xml-style data?
Ease of debugging, but that's a debateable advantage in this case.
> And can you
> include an example for the javascript-style data transfer in the
> manual?
I'll put it on the to-do list. The short story is that you do
something like:
var objFromSrvr = eval(NW_getFileTxt("http://wherever.com/data.js"));
and in data.js, you'd have a set of statements that result in an
object, like this:
//////////// begin data.js /////////////
var myObj = { arrProp : ["foo", "bar"],
strProp : "baz",
};
// do other stuff to the object here
// the next line is important, as it is
// what "returns" the object from this file.
myObj;
//////////// end data.js ///////////////
HTH.
- --
Alex Russell
[email protected] BD10 7AFC 87F6 63F9 1691 83FA 9884 3A15 AFC9 61B7
[email protected] F687 1964 1EF6 453E 9BD0 5148 A15D 1D43 AB92 9A46
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
iD8DBQE/W6symIQ6Fa/JYbcRApbKAKCTJEDWEivmzxXLOfl6WbZg5Dy++ACfczDl
IKaLH+IpLYs47FIkiRISjYs=
=V+OX
-----END PGP SIGNATURE-----
_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org