-1

How can i refresh a page with a wait of 100 seconds in javascript.

i used

location.reload(); 

but i need to wait for 100 seconds before reloading

Murali Manohar
  • 589
  • 7
  • 35
  • 2
    `setTimeout(function() { window.location.reload(); }, 100000}` – Tushar Nov 24 '15 at 11:26
  • 1
    Note that `setTimeout` is not a very precise thing. Setting it to `100000` will probably be close to 100 seconds, but does not guarantee it. Especially, if it is run in the background tab or on a client with the lack of resources. – Yeldar Kurmangaliyev Nov 24 '15 at 11:27
  • 2
    See the previous discussed thread.. Visit http://stackoverflow.com/questions/1217929/how-to-automatically-reload-a-web-page-at-a-certain-time – Nishant Kumar Nov 24 '15 at 12:07

2 Answers2

4
setTimeout(function(){
   location.reload(); 
},100000);
Ramanlfc
  • 8,283
  • 1
  • 18
  • 24
4

To reload a page, you don't want to use second argument

 <meta http-equiv="refresh" content="100" />

Reload a page every 100 seconds

Dharani Dharan
  • 624
  • 1
  • 7
  • 18