I create a new image using
img = new Image();
img.src = image_url;
Then I assign img.src to the img src tag in the DOM
$("#my_img").attr("src", img.src);
How to find out that img.src is 100% loaded? What is the best practice?
img.completeIt seems to me that in some browsers there are few errors.
So, in other words, I need to assign img.srcto $("#my_img")only after img, it was 100% loaded.
Thank!
source
share