You just need to upgrade src. Of course, you should use cache bitter to avoid browser caching when destroying an image. A solution in this case would be a random query string parameter.
$(function() {
var $img = $('<img>', {
src: 'ww.jpg'
}).appendTo(document.body);
setInterval(function() {
$img.attr('src', function(_, src) {
return [src, '?', ~~(Math.random() * 40000)].join('');
});
}, 12500);
});
jAndy source
share