Pass an array into JScript from <%RS%> (

Results 1 to 2 of 2

Thread: Pass an array into JScript from <%RS%> (

  1. #1
    Join Date
    Dec 1969
    Posts
    13

    Default Pass an array into JScript from <%RS%> (

    How do I read a record set using VBS into a JavaScript array?<BR>Or better yet can I get JScript to do ADO stuff? <BR>ColdFusion has a device that will pass stuff from a CF... into JavaScript so it can be played with on the client. Can we do same in ASP?

  2. #2
    Randy Guest

    Default RE: Pass an array into JScript from <%RS%

    Javascript can use ADO but only if use use it server side. bummer<BR><BR>So you could do something like this..<BR><BR>&#060;script language=javascript&#062;<BR> var j_array = new Array();<BR> &#060;% num = 0 %&#062;<BR> &#060;% while not rs.eof %&#062;<BR> j_array(&#060;%= num %&#062;) = &#060;%= rs("yourfield") %&#062;;<BR> &#060;% num = num + 1 %&#062;<BR> &#060;% rs.movenext %&#062;<BR> &#060;% wend %&#062;<BR>&#060;/script&#062;<BR><BR>...this will dynamically create client side script.<BR><BR>-OR- <BR><BR>Have you thought of using Microsoft Remote Scripting?<BR>http://www.microsoft.com/scripting<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •