If you use new Imageto preload images, you can do the following to receive a notification that it has been downloaded
var img = new Image();
img.onload = function() {
document.getElementById("myDiv").innerHTML = "%3Cimg src='myimg.jpg' alt=''/%3E";
};
img.src = "myimg.jpg";
src onload.