Check if the image is loaded from cache or not
You will have to handle your load bindings selectively. You can verify load by testing the Image object property complete
.
For example:
$('.images_to_load').each(function(index, elem)
{
if (!elem.complete) {
$(elem).on('load', function(){
console.log('image loaded from server');
});
}
else {
console.log('image loaded from cache');
}
});
How to use this code: It is important that you have image tags (without the src attribute) with class images_to_load
on your page when executing above code. After adding the src attribute (the url) you will be able to find out if an image has been loaded from cache or not.