Skip to content

Instantly share code, notes, and snippets.

@timothycarambat
Created September 11, 2019 17:47
Show Gist options
  • Save timothycarambat/072f2b5155ed098ad5ff700d10296b4d to your computer and use it in GitHub Desktop.
Save timothycarambat/072f2b5155ed098ad5ff700d10296b4d to your computer and use it in GitHub Desktop.
Show Random URL in iframe on page load. r/programmingrequests for u/XxRewirexX :: https://www.reddit.com/r/programmingrequests/comments/d2kvyb/need_a_random_page_served_from_a_single_url/
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Random Page</title>
</head>
<body>
<script type="text/javascript">
var urlList = [
"https://thebandgo.com",
"https://qwilr.com",
"https://simpleform.xyz",
"https://jumpstory.com",
]
var node = document.createElement('iframe')
node.width = window.innerWidth
node.height = window.innerHeight
node.src = urlList[ Math.floor(Math.random()*urlList.length)]
document.body.appendChild(node)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment