View Full Version : Need random page Java script.
blind
12-12-2001, 08:19 PM
I tried searching the archive, but I couldn't find anything useful. I need a script that will randomly load a page.
For instance someone goes to my site. They see a black page (page 1.) Then 1 second later another person (not necessarily the same) goes to the same URL and sees a white page (page 2.) If anyone can help me out "that would be greeeaaat" -Office Space
ADIDAS
12-12-2001, 08:23 PM
Set it up in your httpd.conf file if one a dedicated server....
Or or httaccess file!
Easy nuff!
blind
12-12-2001, 08:54 PM
I suck with that stuff man.
Can you give me the htaccess code?
ComaToast
12-12-2001, 09:16 PM
JavaScript...
<script language='JavaScript'>
var number=5;
var random_number=0;
link = new Array(5);
link[0] = "http://www.yahoo.com";
link[1] = "http://www.google.com";
link[2] = "http://www.altavista.com";
link[3] = "http://www.aol.com";
link[4] = "http://www.dmoz.org";
function loadRandomPage()
{
today=new Date();
jran=today.getTime();
ia=9301;
ic=49297;
im=233280;
jran = (jran*ia+ic) % im;
random_number=Math.ceil( (jran/(im*1.0)) *number);
window.location=link[random_number-1];
}
</script>
</head>
<body 0NLOAD="loadRandomPage()">
ComaToast
12-12-2001, 09:17 PM
And remember blind, the guy that gave you that is a guy you knocked a star off of.
blind
12-12-2001, 10:24 PM
Thanks Coma, when did I knock your star off?
blind
12-12-2001, 10:29 PM
Hmm, I Coma, that script doesn't seem to be working. I tried using it on both the actual enter page and the index page and I never saw a change =(
ComaToast
12-12-2001, 11:50 PM
Originally posted by blind:
<STRONG>Hmm, I Coma, that script doesn't seem to be working. I tried using it on both the actual enter page and the index page and I never saw a change =(</STRONG>
Erm...hope you didn't cut n' paste it out of the above....ONLOAD is not allowed in UBB. I used a zero for the 0NLOAD.
vBulletin® v3.7.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.