Ask a Question related to HTML & CSS, Design and Development.
-
northerncaller webforumsuser@macromedia.com #1
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
-
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... -
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... -
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... -
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... -
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 -
mick_white #2
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.
>
> northerncallermick_white Guest
-
jason kennedy #3
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...employees=["Alabama","Alaska","Arizona","Arkansas","Californi a","Colorado","> <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
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","NorthIsland","South Carolina","South> Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania", "Rhode
Dakota","Tennessee","Texas","Utah","Vermont","Virg inia","Washington","West
Virginia","Wisconsin","Wyoming"]on the corporate website I'm building, but he wants them presented in random> 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
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



Reply With Quote

