Jump to content

Random Redirect


KyleKJune
 Share

Recommended Posts

hi i want to make a javascript that will redirect the user who clicked the link to a random page on my website. i have found ways to do it but none work in internet explorer. internet explore restricts activex from running.is there a way to make a webpage that will redirect the person who goes to it to a random one of the websites below each time they go to the webpage and work in internet explorer?www.exuad.tkwww.meomb.tkwww.venep.tkwww.keell.tkwww.neign.tkwww.holae.tkwww.hygre.tkwww.mudsu.tkwww.enjoh.tkwww.lockn.tkwww.swipu.tkwww.tizep.tkwww.emenc.tkwww.nonve.tkwww.powdu.tkwww.snomy.tkwww.subda.tkwww.hynid.tkwww.cruct.tkwww.osist.tk

Link to comment
Share on other sites

store addresses in array, then run JavaScript random number generator to produce a number, retrieve address relating to random number, and add that address to the to link.var myArrayname = new Array('addr1','addr2','addr3');ORvar myArrayname = new Array();myArrayname[0] = "addr1";myArrayname[1] = "addr2";myArrayname[2] = "addr3";var myArrayRef = Math.ceil(Math.random() * myArrayname.length-1)document.getElementById('myAnchor').href=myArrayname[myArrayRef];

Edited by dsonesuk
Link to comment
Share on other sites

store addresses in array, then run JavaScript random number generator to produce a number, retrieve address relating to random number, and add that address to the to link.var myArrayname = new Array('addr1','addr2','addr3');ORvar myArrayname = new Array();myArrayname[0] = "addr1";myArrayname[1] = "addr2";myArrayname[2] = "addr3";var myArrayRef = Math.ceil(Math.random() * myArrayname.length-1)document.getElementById('myAnchor').href=myArrayname[myArrayRef];
i tried those. it wont work in IE. IE shows an error about activex saying its unsafe and they wont load it.
Link to comment
Share on other sites

Nothing that dsonesuk showed you uses an activeX object. You should not even need an activeX object to change a page's location. You'd better show how you're implementing this stuff. Post some code.

Link to comment
Share on other sites

Are you sure you aren't testing on your own computer? Put your testing file on an HTTP server, and run it from there. It should work with no warnings. If it still does (or it doesn't work), post your code.

Link to comment
Share on other sites

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><title>home</title><meta http-equiv="Content-type" content="text/html;charset=UTF-8"></head><body><script type="text/javascript">var myArrayname = new Array();myArrayname[0] = "http://www.exuad.tk";myArrayname[1] = "http://www.venep.tk";myArrayname[2] = "http://www.neign.tk";myArrayname[3] = "http://www.hygre.tk";myArrayname[4] = "http://www.enjoh.tk";myArrayname[5] = "http://www.swipu.tk";myArrayname[6] = "http://www.emenc.tk";myArrayname[7] = "http://www.powdu.tk";myArrayname[8] = "http://www.subda.tk";myArrayname[9] = "http://www.cruct.tk";myArrayname[10] = "http://www.meomb.tk";myArrayname[11] = "http://www.keell.tk";myArrayname[12] = "http://www.holae.tk";myArrayname[13] = "http://www.mudsu.tk";myArrayname[14] = "http://www.lockn.tk";myArrayname[15] = "http://www.tizep.tk";myArrayname[16] = "http://www.nonve.tk";myArrayname[17] = "http://www.snomy.tk";myArrayname[18] = "http://www.hynid.tk";myArrayname[19] = "http://www.osist.tk";var myArrayRef = Math.ceil(Math.random() * myArrayname.length-1)document.getElementById('myAnchor').href=myArrayname[myArrayRef]; </script></body></html>
this code above is not working in any browser.
Link to comment
Share on other sites

You need to actually have an anchor with ID "myAnchor" for this to work.Add this right between <body> and <script>:

<a id="myAnchor" href="">Redirect...</a>

You could also (instead and/or in addition to this) try to add:

window.location = myArrayname[myArrayRef];

Right before the script ends.

Link to comment
Share on other sites

put javascript code within function, run this function onload ie window.onload=runthisfunction; (outside of function) move this code to the head.add <a href="#" id="myAnchor">Click this random link</a> to body<head><script type="text/javascript">function runthisfunction(){random link code}window.onload=runthisfunction;</script></head><body><a href="#" id="myAnchor">Click this random link</a></body

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...