Check out this example which reads a double array "abc" of ASP to double array "a" of javascript
<%
dim abc(2,2)
abc(0,0)="a"
abc(0,1)="b"
abc(0,2)="c"
abc(1,0)="d"
abc(1,1)="e"
abc(1,2)="f"
abc(2,0)="g"
abc(2,1)="h"
abc(2,2)="i"
%>
<script language="javascript">
a=new Array(<%=ubound(abc,1)+1%>)
for (i=0;i<<%=ubound(abc,1)+1%>;i++)
a[i]=new Array(<%=ubound(abc,2)+1%>)
<%
for i=0 to ubound(abc,1)
for j=0 to ubound(abc,2)
Response.write ("a[" & i & "][" & j & "]='" & abc(i,j) & "';" & vbcrlf)
next
next
%>
for (i=0;i<<%=ubound(abc,1)+1%>;i++)
for (j=0;j<<%=ubound(abc,2)+1%>;j++)
alert(a[i][j])
</script>
Regards
Raj
|