Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing VB array values to a javascript array

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I can store information into a VBscript array, now I want to pass these values to a JavaScript array. How can I do this?
 
is the vbscript array client side or server side? how about the javasript array? [sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
The VBScript array is populated at the server side (database data information are stored in this array). Once the information has been gathered it should then be available at the client side, need to use javascript for this. That is my problem, I need this information to be passed to a Javascript array. I remember coming across a website where they had that trick, wish I could remember that site (late night surfing, last time I delay my browser history!). If you can help me, I would appreciated.
 
warning: untested. may contain typos.

assuming your vbscript array is called vbsArray()

<%
response.write &quot;<script language='javascript'>&quot; & vbcrlf
response.write &quot;var jsArray = new Array(&quot;
for i = 0 to ubound(vbsArray) - 1
response.write &quot;'&quot; & vbsArray(i) & &quot;',&quot;
next
response.write &quot;'&quot; & vbsArray(ubound(vbsArray)) & &quot;')&quot; & vbcrlf
response.write &quot;</script>&quot;
%>

nick bulka

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top