javascript array and loop question

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default javascript array and loop question

    I'm passing in a comma delimited list as a parameter to a function.
    Ex. the argument passed in holds the following values: 1, 2, 3, 4, 5,

    I need to place those values into array, which I think I can do using the
    split method:

    myArray = myList.split(",");

    Once I have the values in an array, I need to setup a loop to cycle through
    all values in the array and use the each array index value perform some
    routines.

    I'm not sure how to setup the loop? Is there a UBound method in Javascript?
    How do I identify how many values are in the array?

    for(x=0; x <= ?; x++)

    execute code...myArray[1]

    Thanks,
    -D-


    -D- Guest

  2. Similar Questions and Discussions

    1. loop through array to build a new array
      If I combine the following 2 functions (accesses by clicking a checkbox), as result the new array does not contains all items that matches the...
    2. if/loop/array question
      I'm trying to display an add or delete button dependent upon logged in user and I can't figure it out. Can someone please help with the...
    3. array data matches but array created in loop doesn't work
      I have the exact same data in two arrays, but only the array created like so will work: $spaw_imglibs = array( array( 'value' =>...
    4. loop in javascript
      Hi! I have a menu-system in JavaScript. The menu is displayed by two js functions ( DrawMenuBar and DrawSubMenu ). the first function displays...
    5. Question on Dynamic Array/Nested Loop approach
      Hello, I have the following code which populates as table data from a SQL Server 2000 stored proc (RSByDemoID2). Below that is the view and...
  3. #2

    Default Re: javascript array and loop question

    Try

    for(x=0; x < myArray.length; x++)

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139