Skip to content

Instantly share code, notes, and snippets.

@borisBelloc
Created November 13, 2018 19:51
Show Gist options
  • Save borisBelloc/b7e1add776aca9fb631612b7895637f5 to your computer and use it in GitHub Desktop.
Save borisBelloc/b7e1add776aca9fb631612b7895637f5 to your computer and use it in GitHub Desktop.
Javascript auto-refresh page (html / JS)
<!DOCTYPE html>
<head>
<title>POC : Auto-reload script</title>
</head>
<body>
<!--
Add this script into your html page;
inside the <body> </body>
It will refresh/reload page every 3 seconds.
Time is in milliseconds (1000 = 1 sec)
-->
<script>
window.onload = function() {
setInterval(function() { location.reload(); } , 3000);
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment