1

I am having a touch screen with some very basic html pages. But if there is no activity for maybe 5 minutes, it should reload the main page again. So if I the main index.html page where there are links to siteb.html and sitec.html - it should after few minutes without activity load main.html again, even if standing on sitec.html

So it is not just a refresh of the site, but a load of the main page if there is no activity

Is there any scipt for this or an example I can try and test ?

hans hansen
  • 21
  • 1
  • 2

2 Answers2

1

<!DOCTYPE html>
<html>
<body>

<input type="text">
<button onclick="myFunction()">Reload page</button>

<script>
function myFunction() {
    location.reload();
}
</script>

</body>
</html> 
Nihal
  • 5,262
  • 7
  • 23
  • 41
1

You can use following code also which includes time interval that means after 300 seconds page will be refreshed.

         setInterval(function() {
              window.location.reload();
            }, 300000);