[Javascript] Passing data

TomMallard mallard at serv.net
Tue Apr 3 17:42:04 CDT 2001


If you pass in the data as a string to the target page...could be a form
value (call it dataIn) that is submitted to the page using POST to handle
large strings...if there's more than one value you need to catch the end of
the substring using another indexOf("nextFieldName=")...

var queryString = location.search
var strInput = queryString.substring(queryString.indexOf("dataIn=")+7)
// strInput will contain 'dis=0,cout=43431132...'

var arrayPairs = split(strInput, ",") //results in key-value pairs..

for(i=0;i<arrayPairs.length;i++){
    var keyValues = split(arrayPairs[i], "=") //this gives you a pair...
    // now you could use these to populate a select box dynamically, etc.
    var strName = keyValues[0].value
    var intValue = keyValues[1].value
}

Like Becam was saying, need to know what the end use is, this is set up for
the client, the filesystemobject is server-side.

tom
----- Original Message -----
From: "Steve White" <steve at VirtualMechanics.com>
To: <javascript at LaTech.edu>
Sent: Tuesday, April 03, 2001 2:32 PM
Subject: RE: [Javascript] Passing data


> I am not familiar with Split() but I assume that it is some type of string
> parser. If so the problem I am trying to figure out is how do I pass the
> data? If I have a SCRIPT in a HTML file how do I include the code or can I
> just put it in a .txt file and read it. Does js even have a Read File
> operation?
>
> I need to get a good reference book.
>
> Thanks
>
> Steve White
> www.VirtualMechanics.com
> www.DHTMLMagic.com
> www.SVGMagic.com
> www.IMSWebTips.com
>
> -----Original Message-----
> From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
> Behalf Of TomMallard
> Sent: Tuesday, April 03, 2001 2:23 PM
> To: javascript at LaTech.edu
> Subject: Re: [Javascript] Passing data
>
>
> If you used ASCII and kept your key=value pairs it would make parsing it
out
> on the client pretty simple with split().
>
> Just a thought,
>
> tom
> ----- Original Message -----
> From: "Ian Turner" <ian.turner at romseyassoc.com>
> To: <javascript at LaTech.edu>
> Sent: Tuesday, April 03, 2001 9:26 AM
> Subject: RE: [Javascript] Passing data
>
>
> > Certainly the latter is possible. Though your parsing routine might be
> > complex and therefore large in its own right.
> > It could be done as a server side include file or by putting a string
into
> > the HTML file.
> >
> > All the best
> > Ian
> >
> > -----Original Message-----
> > From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
> > Behalf Of Steve White
> > Sent: 03 April 2001 16:47
> > To: javascript at LaTech.edu
> > Subject: [Javascript] Passing data
> >
> >
> > 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
> >
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > http://www.LaTech.edu/mailman/listinfo/javascript
> >
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > http://www.LaTech.edu/mailman/listinfo/javascript
> >
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list