Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

New Page when Refreshed, Using Javascript

I would like to know how to use Javascript, if possible, to load a new page every time my web site is hit, or reloaded.
ie:
index1.html
index2.html
index3.html
...up to 10 (or whatever number)

each time someone hits, or reloads, a different, random, welcome page is loaded.

Can this even be done?
0
ghstrydr
Asked:
ghstrydr
1 Solution
 
pc012197Commented:
try the following as "index.html"

<html><head><title>loader page</title>
<script>
function newpage()
{
    window.location="index"+Math.ceil(10*Math.random())+".html";
}
</head>
<body onLoad="newpage();">
this is a dummy page
</body></html>

This is about all you need.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now