Solved

New Page when Refreshed, Using Javascript

Posted on 1997-01-27
1
230 Views
Last Modified: 2013-12-25
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
Comment
Question by:ghstrydr
1 Comment
 
LVL 3

Accepted Solution

by:
pc012197 earned 50 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now