Skip to content

Instantly share code, notes, and snippets.

@mokoshalb
Created December 26, 2017 23:43
Show Gist options
  • Save mokoshalb/47db269bf425babbd43c9600c89a0197 to your computer and use it in GitHub Desktop.
Save mokoshalb/47db269bf425babbd43c9600c89a0197 to your computer and use it in GitHub Desktop.
A simple random page redirector using Javascript. Note: Please don't forget to add comma , after each of the link (except the last link) and please put http:// or https:// in-front of each link.
var linkList = [
"https://google.com",
"https://yahoo.com",
"https://facebook.com",
"https://twitter.com",
"https://ebay.com",
"https://youtube.com"
];
var randomLink = linkList[Math.floor(Math.random()*linkList.length)];
window.location.href = randomLink;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment