I am trying to display a progress bar using the progress of loading images. I tried using onload and onprogress as suggested in one previous answer but only onload works.Thanks in advance.
var Img = new Image();
Img.onload = function () {
console.log("loaded");
};
Img.onprogress=function(){
console.log("progress");
};
Img.src = imageUrl;