Presenting a list in random order

Ask a Question related to HTML & CSS, Design and Development.

  1. #1

    Default Presenting a list in random order

    I have a client with 150+ employees, who wants a line for each of them on the corporate website I'm building, but he wants them presented in random order every time the page is downloaded, so there is no apparent favoritism. Can you do this within Dreamweaver or html? Does it need PERL scripting or MySQL? Is there a Dreamweaver extension? I'd appreciate any help anyone can give.

    Thanks.

    northerncaller


    northerncaller webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. random list
      I am looking for a script that will randomly list a set of names. For example, a page that has a list of the US States. Each time the page is opened...
    2. Display dataset results in a random order
      I'm connecting to an MS Access database to retireve my data and wan to display my results in a random order. What i have is a table containing...
    3. random order results from MS access database
      simple question but how could I go about order by search results randomly every time the page loads, or even better set it up so that each time the...
    4. getting a list of random numbers
      Hi, i'm looking for a bit of code or an example that does the following: i give a certain number, let's say 5 and then i want the code to...
    5. random pick from list
      If I have a list, how can I randomly pick one item from it when I click on a button? Thanks Shane
  3. #2

    Default Re: Presenting a list in random order

    <script language="JavaScript">
    Array.prototype.shuffle= function(times){
    var i,j,t,l=this.length;
    while(times--){
    with(Math){
    i=floor(random()*l);j=floor(random()*l);}
    t=this[i];this[i]=this[j];this[j]=t;
    }
    return this;
    }
    var employees=["Alabama","Alaska","Arizona","Arkansas","Californi a","Colorado","Connecticut","Delaware","Florida"," Georgia","Hawaii","Idaho","Illinois","Indiana","Io wa","Kansas","Kentucky","Louisiana","Maine","Maryl and","Massachusetts","Michigan","Minnesota","Missi ssippi","Missouri","Montana","Nebraska","Nevada"," New Hampshire","New Jersey","New Mexico","New York","North
    Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania", "Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virg inia","Washington","West Virginia","Wisconsin","Wyoming"]
    document.write(employees.shuffle(200).join("<BR>") )
    </script>

    "\"northerncaller\" webforumsuser"@macromedia.com wrote:
    > I have a client with 150+ employees, who wants a line for each of them on the corporate website I'm building, but he wants them presented in random order every time the page is downloaded, so there is no apparent favoritism. Can you do this within Dreamweaver or html? Does it need PERL scripting or MySQL? Is there a Dreamweaver extension? I'd appreciate any help anyone can give.
    >
    > Thanks.
    >
    > northerncaller
    mick_white Guest

  4. #3

    Default Re: Presenting a list in random order

    What would exhibit less favouritism than simple alphabetical order?
    It's worked in that arena of inflated egos, the theatre, for hundreds of
    years
    And how about when someone wants to scan the list to find one of your 150
    employees?
    Will they appreciate the random aspect then?

    just suggestions

    Jason

    "mick_white" <mick@gerrytimlin.com> wrote in message
    news:3F268663.9CCA6AFE@gerrytimlin.com...
    > <script language="JavaScript">
    > Array.prototype.shuffle= function(times){
    > var i,j,t,l=this.length;
    > while(times--){
    > with(Math){
    > i=floor(random()*l);j=floor(random()*l);}
    > t=this[i];this[i]=this[j];this[j]=t;
    > }
    > return this;
    > }
    > var
    employees=["Alabama","Alaska","Arizona","Arkansas","Californi a","Colorado","
    Connecticut","Delaware","Florida","Georgia","Hawai i","Idaho","Illinois","Ind
    iana","Iowa","Kansas","Kentucky","Louisiana","Main e","Maryland","Massachuset
    ts","Michigan","Minnesota","Mississippi","Missouri ","Montana","Nebraska","Ne
    vada","New Hampshire","New Jersey","New Mexico","New York","North
    > Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania", "Rhode
    Island","South Carolina","South
    Dakota","Tennessee","Texas","Utah","Vermont","Virg inia","Washington","West
    Virginia","Wisconsin","Wyoming"]
    > document.write(employees.shuffle(200).join("<BR>") )
    > </script>
    >
    > "\"northerncaller\" webforumsuser"@macromedia.com wrote:
    >
    > > I have a client with 150+ employees, who wants a line for each of them
    on the corporate website I'm building, but he wants them presented in random
    order every time the page is downloaded, so there is no apparent favoritism.
    Can you do this within Dreamweaver or html? Does it need PERL scripting or
    MySQL? Is there a Dreamweaver extension? I'd appreciate any help anyone can
    give.
    > >
    > > Thanks.
    > >
    > > northerncaller
    >

    jason kennedy Guest

Posting Permissions

  • You may not post new threads
  • You may not 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