-----Original Message-----
OK relooking at the OP I'm confused, are your coding ASP in VBscript
or Jscript ???
in VBscript arrays are used with rounded brackets and Jscript uses sqr
brackets
eg
VBscript: myArray(5)
Jscript: myArray[5]
The code I wrote b4 was for ASP Jscript.
so for ASP VBscript you could do this:
' direct to Page:
DIM i
for i = 0 to ubound(a)
Response.Write "<br>a("& i &") ="' & a(i));
next
<!--As clientside alerts: -->
<script language="javascript">
<%
DIM i
for i = 0 to ubound(a)
Response.Write "alert (""a("& i &") =" & a(i) & """);" ;
next
%>
</script>
HTH.
Al
Alert is a CLIENT site command.
so you would either have the asp code write client code... or just
simply use Response.Write to write out the value.
asp:
for (var i=0; i<a.length; i++) {
Response.Write ('<br>a['+i+'] = ' + a
);
}
client:
<script language="javascript">
<%
for (var i=0; i<a.length; i++) {
Response.Write ('alert ("a['+i+'] = ' + a + '")');
}
%>
</script>
Last bit not tested as I have a seperate function called "DebugOut"
which basically does the ASP way with colors and only if on localhost.
HTH.
Al
Hi to all
I have a asp page that have an array for instance:
<%
a(0)=0
a(1)=1
a(2)=2
a(3)=3
%>
I would like to show each element of the array with
alerts in javascript... Do you know what its the way to
make something like this...
Thanks in advance and happy new year.
josema
.