Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP variable with javascript

    Hi,

    How do I increment the variable i inside the arrayKey(i) variable?

    <script>
    for(i=0; i<5;i++){
    document.write("<%=arrayKey(i)%><br>");
    }
    </script>

    thx
    joe

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,898
    Thanks
    203
    Thanked 2,530 Times in 2,508 Posts
    <script>
    var arrayKey = new Array();
    for(i=0; i<5;i++){
    arrayKey[i] = i;
    alert (arrayKey[i]);
    document.write("<%=arrayKey[i]%><br>");
    }
    </script>
    Last edited by Philip M; 05-26-2006 at 07:38 AM.


  •  

    Posting Permissions

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