Click to See Complete Forum and Search --> : Random Link Generator


ThaSpY
01-31-2003, 02:00 AM
i am looking for a script... 1 where u have a link... and the user clicks the link... then it sends them to a random page (where i can pick the choices for random link)... but, it popups the random page into a new window, with these attributes:

toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=474,height=317,left=163,to p=132

lol, i hope im making sense... but yes, this shouldnt be to hard for all u xperts out there. if u could pls help me out, great!

thank you,
thaspy
http://www.xeon.filetap.com/

swon
01-31-2003, 07:02 AM
U can use something like this:

<script language="JavaScript">
function randomLink(){

defaultUrl = "http://www.google.com"; // set a defaultUrl
var links = new Array (
"http://www.google.com",
"http://www.microspot.com",
"http://www.microsoft.com",
"http://www.search.ch",
"http://www.gibtsnicht.de"); // your urls

ran = Math.random()*10;
ran = Math.round(ran);
if(ran < links.length)
{
var w = window.open(links[ran],'RandomWin','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=474,height=3 17,left=163,top=132');
}
else{
var w = window.open(defaultUrl,'RandomWin','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizabl e=0,width=474,height=317,left=163,top=132');
}
}
</script>
<body>
<a href="#" onClick="randomLink();return false">random</a>
</body>