javaSCRIPT help needed!

Out of context: Reply #1

  • Started
  • Last post
  • 13 Responses
  • frankbb0

    i have just tried this script to find out if it was getting the array value..

    var thePics = new Array()

    thePics[0] = "images/photos/002_blueflowers_t...
    thePics[1] = "images/photos/002_blueflowers_t...

    for(i=0;i<=50;i++){
    var rn = Math.floor(Math.random() * thePics.length)
    document.write(thePics[rn]+'');
    }

    seems to be fine, but I would start adding stuff to the array at 0 and not at 1..

View thread