Skip to content

Instantly share code, notes, and snippets.

@dommmel
Created June 4, 2013 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dommmel/5704936 to your computer and use it in GitHub Desktop.
Save dommmel/5704936 to your computer and use it in GitHub Desktop.
refresh page on random intervals
function doSomething() {
open(location.href, 'refreshingWindow');
}
(function loop() {
var rand = Math.round(Math.random() * (10000)) + 1000;
setTimeout(function() {
doSomething();
loop();
}, rand);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment