Skip to content

Instantly share code, notes, and snippets.

@joshski
Created March 25, 2014 17:42
Show Gist options
  • Save joshski/9767155 to your computer and use it in GitHub Desktop.
Save joshski/9767155 to your computer and use it in GitHub Desktop.
Monitor remote websites, in style
<html>
<body>
<h1 id="heading"></h1>
<iframe id="frame" src="about:blank" style="width: 100%; height: 100%"></iframe>
<script type="text/javascript">
var urls = [
'http://httpbin.org/status/418',
'http://httpbin.org/headers'
];
var index = 0;
function showNextUrl() {
document.getElementById('frame').src = document.getElementById('heading').innerHTML = urls[index];
index++;
if (index >= urls.length) index = 0;
}
showNextUrl();
setInterval(showNextUrl, 10000);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment