Created
June 27, 2014 00:57
-
-
Save n8foo/e1c2d65c833c8e49e83e to your computer and use it in GitHub Desktop.
javascript snippit to reload all the images on a page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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