[Javascript] Reading values into an array

Alan Easton alan.easton at unn.ac.uk
Tue Jul 15 08:54:58 CDT 2003


Hi Chris,

Thanks for that.

I have tried something ike that, using Getrows().

But I have trouble cross referenceing between vbscript and javascript. The
piece of code you sent writes the values out onto the page. How would I get
them back into the javascript array....???

Let me know if I am missing something obvious here....thanks....

Alan...

-----Original Message-----
From: Chris Tifer [mailto:christ at saeweb.com]
Sent: 15 July 2003 14:37
To: [JavaScript List]
Subject: Re: [Javascript] Reading values into an array


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
>

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


More information about the Javascript mailing list