[Javascript] Passing data

Steve White steve at VirtualMechanics.com
Tue Apr 3 10:47:05 CDT 2001


We generate large graphic data structures to be processed by our included js
code. I would like to reduce the size of the data as much as possible.

Instead of passing the data as variable assignments it would be better to
pass it as binary or if that is not possible at least as a sequence of ASCII
values. So instead of:

Mctl[2][0].dis=0;
Mctl[2][0].cout=43431132;
Mctl[2][0].rgb1=33593818;
Mctl[2][0].rgb2=10066329;
Mctl[2][0].lwid=0;
Mctl[2][1] = new Array();
Mctl[2][1].sclx=1.00;
Mctl[2][1].scly=1.00;
Mctl[2][1].rot=-91.00;
Mctl[2][1].tim=363;
Mctl[2][1].dis=238;
Mctl[2][1].cout=43431132;

I could do something like:

0, 43431132,33593818,10066329,0,1.00,1.00,91.00,363,238,43431132;

Can JavaScript be used to read an attached binary or ASCII file? Or could it
be included within the SVG/HTML document as a huge string and then parsed
following the onload event?

Thanks

Steve White
www.VirtualMechanics.com
www.DHTMLMagic.com
www.SVGMagic.com
www.IMSWebTips.com





More information about the Javascript mailing list