[Javascript] Reading values into an array

Chris Tifer christ at saeweb.com
Tue Jul 15 08:37:23 CDT 2003


It's not tricky at all actually...

var my_values = new Array()

<%
DIM intRow
FOR intRow = 0 to UBOUND(arrRecordset, 2) ' assuming you're using GetRows
    %>
    my_values[<%=intRow%>] = "<%=arrRecordSet(fieldName, intRow)%>"
    %<
NEXT
%>

That (or something like that) should produce your array...

Chris Tifer
http://emailajoke.com

----- Original Message -----
From: "Alan Easton" <alan.easton at unn.ac.uk>
To: "'Java-List'" <javascript at LaTech.edu>
Sent: Tuesday, July 15, 2003 8:52 AM
Subject: [Javascript] Reading values into an array


> Hello All,
>
> I have the results of an ASP recordset that I would like to read into a
> Javascript array. My recordset only returns 3 records, so I need to end up
> with a javascript 1D array similar to:
>
> var my_values=new Array("photo1.jpg","photo2.jpg","photo3.jpg")
>
> Where photo1.jpg, photo2.jpg, photo3.jpg are the 3 records that have been
> returned in my recordset.
>
> Does any one have any idea on how I would go about doing this. I realise
it
> is tricky going from ASP recordsets to 1D javascript arrays, but I need
some
> guidance.
>
> Any suggestions or links to further information would be much appreciated.
>
> Thanks,
>
> Alan...
>


----------------------------------------------------------------------------
----


> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>



More information about the Javascript mailing list