I want to do:
$(\"img\").bind(\'load\', function() {
// do stuff
});
But the load event doesn\'t fire when the image is loaded from cache
A solution I found https://bugs.chromium.org/p/chromium/issues/detail?id=7731#c12 (This code taken directly from the comment)
var photo = document.getElementById('image_id');
var img = new Image();
img.addEventListener('load', myFunction, false);
img.src = 'http://newimgsource.jpg';
photo.src = img.src;