-4

I want to refresh a web page using javascript but when any event occur after few second the page will refresh. what can i do?

  • Possible duplicate of [How do I get JavaScript to delay, and then refresh the page](http://stackoverflow.com/questions/32752696/how-do-i-get-javascript-to-delay-and-then-refresh-the-page) – Skatox Jan 10 '17 at 19:14

2 Answers2

3

You can try setTimeout()

setTimeout(function() {
      // Do something after 5 seconds
      location.reload();//reload page
}, 5000);
Manwal
  • 23,450
  • 12
  • 63
  • 93
0

Use meta tag like <meta http-equiv="Refresh" content="300"> This wiil make your page to refresh every 5minutes (5*60)

koninos
  • 4,969
  • 5
  • 28
  • 47