I use a function to dynamically load images into a div via an ajax call. I need to show the gif image of the upload when the image starts to load and hide when all the images finish uploading. My main task is to find out when all the images have finished loading.
This is my code.
$('img').on('load', function ()
{
alert("image loaded: "+this.src);
});
But this warning continues to trigger every image.
Remember that images are loaded via an ajax call after the page loads.
source
share