Click to See Complete Forum and Search --> : Changing random script to sequential.


myrdhinn
08-15-2003, 09:03 PM
I was wondering if anyone could help me with this. Is it possible to change a script that is setup to go to a random URL into one that will give the URLs in a sequential order rather than random.

Regards

Ray

Khalid Ali
08-15-2003, 09:51 PM
:confused: :confused:
aaannnhh..

I swear I did not drink anything tonight(yet)but I still did not understand your question

myrdhinn
08-15-2003, 10:17 PM
I have a generate random URL script but I would like it to be a generate sequential URL script. I don't know how to change it so that it doesn't select a random URL.

I would like it to select the URL from position 1 and go to position 14 in sequence then start at the top again.

links[12] = "http://www.permaworld.org/members/lucymortimore/join.shtml"
links[13] = "http://www.permaworld.org/members/alfredforbes/join.shtml"
links[14] = "http://www.permaworld.org/members/mybaby/join.shtml"

function random() {
return Math.round(14 * Math.random());
}

function randomLink() {
var a = random()
location = links[a]
}
// -->
Can the random function be changed to sequential?

Ray

Khalid Ali
08-16-2003, 08:00 AM
just run through the array that contains all the links
and you are all set.

Charles
08-16-2003, 08:03 AM
From the looks of things, I'd say that he or she will have to use cookies to save state.