Skip to content

Instantly share code, notes, and snippets.

@n8foo
Created June 27, 2014 00:57
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 n8foo/e1c2d65c833c8e49e83e to your computer and use it in GitHub Desktop.
Save n8foo/e1c2d65c833c8e49e83e to your computer and use it in GitHub Desktop.
javascript snippit to reload all the images on a page
setInterval(function() {
var images = document.images;
for (var i=0; i<images.length; i++) {
images[i].src = images[i].src.replace(/\btime=[^&]*/, 'time=' + new Date().getTime());
}
}, 10000); // 10000 milliseconds = 10 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment