Solved

New Page when Refreshed, Using Javascript

Posted on 1997-01-27
1
236 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
ID: 1853894
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Please explain "Promise Pattern" and how it's used 2 54
Video on my site 4 53
responsive divs setup - what am I doing wrong 2 63
REReplaceNoCase help 1 13
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

914 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

15 Experts available now in Live!

Get 1:1 Help Now