getting server side vbscript array to client side jscript 
Author Message
 getting server side vbscript array to client side jscript

Suppose I have an ASP page with some server side VBScript that fetches some
data from a database. I then want to use some client side jscript to
manipulate some of that data ( an array of floating point numbers). What's
the standard way to make the array from the server side script available to
the client side script? I don't need to have any changes I make to the
client side array affect the original array from the server side script, so
it can be passed by value , so to speak.
Thanks in advance for any help.
Kent.


Sun, 18 Nov 2001 03:00:00 GMT  
 getting server side vbscript array to client side jscript
I don't know vbscript very well, but if I were doing the entire thing in
JScript this is what I would do.  Maybe it will help.

<script>
    aClientSideArray = new Array;
<%
    for( var i = 0; i < aServerSideArray.length; i++ )
        {
%>
        aClientSideArray[ aClientSideArray.length ] = <%=
ServerSideArray[ i ] %>

<%
        }
%>

</script>

Quote:

>Suppose I have an ASP page with some server side vbscript that fetches some
>data from a database. I then want to use some client side jscript to
>manipulate some of that data ( an array of floating point numbers). What's
>the standard way to make the array from the server side script available to
>the client side script? I don't need to have any changes I make to the
>client side array affect the original array from the server side script, so
>it can be passed by value , so to speak.
>Thanks in advance for any help.
>Kent.



Sun, 18 Nov 2001 03:00:00 GMT  
 getting server side vbscript array to client side jscript

Quote:

>I don't know vbscript very well, but if I were doing the entire thing in
>JScript this is what I would do.  Maybe it will help.
>        aClientSideArray[ aClientSideArray.length ] = <%=
>ServerSideArray[ i ] %>

About the only thing wrong is that VBScript uses parenthesis rather than
brackets to index arrays. So it would be

aClientSideArray[aClientSideArray.length] = <%= ServerSideArray(i) %>;

Peter

--

    No longer laying about at home - what a bummer, dude! :-)
JScript FAQ: http://www.netspace.net.au/~torrboy/code/jscriptfaq/



Thu, 22 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. getting server side vbscript array to client side jscript

2. Help converting server-side VBScript array into client-side JScript array

3. How Can I Pass Data Between the Server Side and the Client Side VB/JScript

4. store server-side array in client side

5. store server-side array in client side

6. Passing Server Side Arrays to Client Side Scripts

7. store server-side array in client side

8. server side recordset to client side array

9. Client-side VBScript and Server-side VBScript?

10. Calling Server Side JScript from Server Side VBScript

11. JScript code for both server side and client side

12. Jscript client-side and server-side objects

 

 
Powered by phpBB® Forum Software