Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

reload all images every 5 seconds

View reload_images.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
setInterval(reload_images, 5000);
 
function reload_images(){
$('img').each(reload_image);
}
 
function reload_image(){
var img = $(this), src = img.data('src');
if (typeof src === 'undefined'){
src = img.attr('src');
img.data('src', src);
}
src = src + (/\?/.test(src) ? '&' : '?') + 'at=' + Date.now();
img.attr('src', src);
console.log('reloading', img, src);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.