-1

Hi guys I've read a lots of similar questions but I can't find a specific solution for that.

I try this...but works only for the first reload than after the page is refresh in the background it'll not realod again alone after 5 seconds.

var isActive;

window.onfocus = function () { 
  isActive = true; 
}; 

window.onblur = function () { 
  isActive = false; 
}; 
setInterval(function () { 
  if (isActive == false) {location.reload();}
}, 5000);

Thank u.

Rajaprabhu Aravindasamy
  • 66,513
  • 17
  • 101
  • 130
user3684020
  • 103
  • 1
  • 9

3 Answers3

0

You could try this jquery IdleTimer plugin. It seems to satisfy your requirement.

Cheers..

Devanand
  • 3
  • 1
0

There are lots of method to achieve this problem.Like.......

setTimeout(function(){ window.location.reload(1); }, 5000);

<meta http-equiv="refresh" content="5" />
0

i solve with this.... jsfiddle.net/wve3H

Thank u to everyone

user3684020
  • 103
  • 1
  • 9