• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

Use ASP Array in Javascript

How can I populate an array of this nature with a dynamic asp/vbscsript array?  Since I don't know how many array elements we will have I will need to use a for-next loop.
      imagearray: [
            ["/images/crutchfield/interior1.jpg"],
            ["/images/crutchfield/interior2.jpg"],
            ["/images/crutchfield/interior3.jpg"],
            ["/images/main_flash/main_flash1.jpg"],
            ["/images/main_flash/main_flash2.jpg"],
            ["/images/main_flash/main_flash3.jpg"],
            ["/images/main_flash/main_flash4.jpg"],
            ["/images/main_flash/main_flash5.jpg"],
            ["/images/main_flash/main_flash6.jpg"]
      ],
Thank you very much.
0
Bob Schneider
Asked:
Bob Schneider
  • 2
2 Solutions
 
EyalCommented:
var imagearray = new Array(
           "/images/crutchfield/interior1.jpg",
            "/images/crutchfield/interior2.jpg",
            "/images/crutchfield/interior3.jpg",
            "/images/main_flash/main_flash1.jpg",
            "/images/main_flash/main_flash2.jpg",
            "/images/main_flash/main_flash3.jpg",
            "/images/main_flash/main_flash4.jpg",
            "/images/main_flash/main_flash5.jpg",
            "/images/main_flash/main_flash6.jpg"
      )
0
 
Bob SchneiderAuthor Commented:
I need something that will take an existing array and incorporate it as follows:

var imagearray = new Array(
        <%For i = 0 To UBound(PixArray, 2) - 1%>
             ...what goes here....
       <%Next%>
)
0
 
EyalCommented:
var imagearray = new Array(
        <%For i = 0 To UBound(PixArray, 2) - 1
             response.write("'" & Replace(PixArray[i],"'","\'") & "'")
       Next%>
);

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now