• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • 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 SchneiderCo-OwnerAuthor 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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