Donate SIGN UP

Random Page Order

Avatar Image
siouxfire | 16:05 Thu 02nd Oct 2003 | Technology
2 Answers
I have three web pages that branch from a separate page. I want them to appear in a random order. I don't know HTML very well and I'm using Dreamweaver. How do I create a link that will randomly go to 1 of 3 pages?
Gravatar

Answers

1 to 2 of 2rss feed

Best Answer

No best answer has yet been selected by siouxfire. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
I'm sure there are more sophisticated ways, but how about create three copies of the page each one pointing to one of the three random pages. Then add a line to the top of each of the main page that cause it to refresh, cycling all three. The line is

(META HTTP-EQUIV="Refresh" Content="5; URL=xxx.htm)>

Replace ( ) with angle brackets

This sounds like a problem for JavaScript. Without actually coding this for you what you need to do is:
  • declare local variables
  • define a 3 element array
  • put the URL for each page into the array
  • get a random number from 1 to 3
  • invoke a window open command with the chosen array element as a parameter.
I don't know a way of generating randomness with static HTML, as it is not really a programming language. Any half decent JavaScript reference book will give you the details on this if you don't already know,

1 to 2 of 2rss feed

Do you know the answer?

Random Page Order

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.