Results 1 to 3 of 3

Thread: Array

  1. #1
    Duc Guest

    Default Array

    How do I transfer data between a serverside recordset and a client side array?<BR>Thanks,<BR>Duc

  2. #2
    Join Date
    Dec 1969

    Default RE: Array

    Response.Write() it into the javascript code. easy<BR><BR>j

  3. #3
    Join Date
    Dec 1969

    Default RE: Array

    If all the items in the client-side JS array are strings (or can at least be treated as strings), then it is especially easy to do using RecordSet.GetString.<BR><BR>Something like this:<BR><BR>&#060;%<BR>... get the RS ...<BR><BR>Response.Write "&#060;" & "SCRIPT Language=&#039;JavaScript&#039;&#062;" & vbNewLine<BR>Response.Write "var data = new Array(&#039;" & RS.GetString( , ,"&#039;,&#039;","&#039;,"&vbNewLine&"&#039;" ) & "**end**&#039;"<BR>Response.Write ");" & vbNewLine<BR>%&#062;<BR><BR>The will put the entire recordset into one single array. You might want to create an array of arrays, instead, but that&#039;s not overly hard to do.<BR><BR>For a demo of creating an array of *OBJECTS* in the JS code, see" and click on the demo that talks about doing "client-side sorting in JS code" or something to that effect. My code, so ask questions if you need to.<BR><BR><BR><BR><BR><BR><BR><BR><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