title: Track progress of loading image in JavaScript
body: <p>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.</p>
  
  <pre><code>    var Img = new Image();
      Img.onload = function () {
          console.log("loaded");
      };
  
      Img.onprogress=function(){
          console.log("progress");
      };
  
      Img.src = imageUrl;
  </code></pre>