title: Drawing on Canvas - onload not executed
body: <p>i try to darw multiple Images into a canvas.</p>
  
  <p>I use js to Archive this</p>
  
  <pre><code>//in draw method:
   Images[counter] = new Image();
      Images[counter].src = "/anImage.png";
      for (var i = counter; i &gt;= 0; i--)
      {
          attach(ctx, Images[i], xCordinates[i], yCordinates[i]);
      }
  
  function attach (cont, img, x, y) {
      try
      {
  
          img.onload = function () {
  
              cont.drawImage(this, x, y);
          }
      }
      catch(ex)
      {
          alert(ex);
      }
  }
  </code></pre>
  
  <p>The Trouble i have is, taht the images arent shwon properly. in fact, only the last Image is displayed. i check my code an im absolutly sure that the coordinates i submit to the "attach"- method are correct. Due Debugging i find out, taht the onload is only executed for the last Image in the Loop, what am i doing wrong?</p>
  
  <p>Thanks in advance.</p>