www.webdeveloper.com
Results 1 to 2 of 2

Thread: Load random url from list?

  1. #1
    Join Date
    Nov 2008
    Posts
    11

    Load random url from list?

    I'm making a portfolio site and I have 3 different sections, (3 html pages) that I want to be able to load one randomly each time you go to the site. Any ideas? Thanks.

  2. #2
    Join Date
    May 2006
    Location
    Odenton, MD
    Posts
    1,449
    define an array of string, of course, the string are the path to each section. then take a random number with Math.random() method. this number will be use as the index for the array. finally, set the location using the array with the random number.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles