Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Reading values into an array
- From: alan.easton at unn.ac.uk (Alan Easton)
- Subject: [Javascript] Reading values into an array
- Date: Tue Jul 15 08:51:26 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@xxxxxxxxxx] 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@xxxxxxxxx> To: "'Java-List'" <javascript@xxxxxxxxxx> 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@xxxxxxxxxx > https://lists.LaTech.edu/mailman/listinfo/javascript > _______________________________________________ Javascript mailing list Javascript@xxxxxxxxxx https://lists.LaTech.edu/mailman/listinfo/javascript
- Follow-Ups:
- [Javascript] Reading values into an array
- From: Chris Tifer
- [Javascript] Reading values into an array
- Prev by Date: [Javascript] Reading values into an array
- Next by Date: [Javascript] Reading values into an array
- Previous by thread: [Javascript] Reading values into an array
- Next by thread: [Javascript] Reading values into an array
- Index(es):