Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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