Created
August 22, 2014 13:14
-
-
Save beames/7c7fb8e2b9d46b253fad to your computer and use it in GitHub Desktop.
reload page jsbin reload page // source http://jsbin.com/piyur/6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta name="description" content="jsbin reload page" /> | |
<meta charset="UTF-8"> | |
<title>reload page</title> | |
</head> | |
<body> | |
<script> | |
url='http://localhost:1337' | |
</script> | |
<iframe src=url frameborder="0"></iframe> | |
<script> | |
setInterval(function(){ | |
//remove iframe dom | |
var iframe = document.getElementsByTagName("iframe"); | |
iframe[0].parentNode.removeChild(iframe[0]); | |
// create iframe dom | |
iframe = document.createElement('iframe'); | |
iframe.setAttribute("src", url); | |
iframe.setAttribute("frameborder", "0"); | |
document.body.appendChild(iframe); | |
},1000); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment