Skip to content

Instantly share code, notes, and snippets.

@theredpea
Created March 14, 2018 00:17
Show Gist options
  • Save theredpea/5fdd4f27d1c77ef4bd27b71126d14cc0 to your computer and use it in GitHub Desktop.
Save theredpea/5fdd4f27d1c77ef4bd27b71126d14cc0 to your computer and use it in GitHub Desktop.
Refresh events
<html>
<head>
<script >
//Each time the refresh page reloads
//1) a new setTimeout will be created
//2) the refresh-container will get the onload callback executed
setTimeout(function(){ window.location.reload(true); }, 5000);
</script>
</head>
<body>
Will refresh shortly
</body>
</html>
<html>
<head>
<script >
var on_load = function(){
console.log('loaded');
}
</script>
</head>
<body>
<iframe src="refresh.html" onload="on_load();">
</iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment