Use ASP Array in Javascript

Posted on 2011-10-03
Last Modified: 2012-05-12
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: [
Thank you very much.
Question by:Bob Schneider
    LVL 15

    Assisted Solution

    var imagearray = new Array(

    Author Comment

    by:Bob Schneider
    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....
    LVL 15

    Accepted Solution

    var imagearray = new Array(
            <%For i = 0 To UBound(PixArray, 2) - 1
                 response.write("'" & Replace(PixArray[i],"'","\'") & "'")

    Open in new window


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
    This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
    In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now