title: HTMLCanvasContext.drawImage() failing when passed an image found using jQuery
body: <p>The idea of my code is create a hidden div which loads the image. When it's load event is fired draw it in the canvas. When I run the code I get this error 0x80040111 (NS_ERROR_NOT_AVAILABLE), yet I am waiting for the load event. Here is my code.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div id="old-counties-image-wrapper" style="display: none;"&gt;
  &lt;img border="0" height="390" id="interreg-iiia-old-counties-map" src="/f/MISCELLANEOUS/old-map.jpg" /&gt;&lt;/div&gt;
  &lt;p&gt;
  &lt;canvas id="old-counties-image-canvas"&gt;&lt;/canvas&gt;&lt;/p&gt;
  </code></pre>
  
  <p>and javascript</p>
  
  <pre><code> $('#interreg-iiia-old-counties-map').load(function() {
      var canvas=document.getElementById('old-counties-image-canvas');
      if (canvas.getContext) {
           var ctx=canvas.getContext('2d');
           var img=$('#interreg-iiia-old-counties-map');
           ctx.drawImage(img, 0, 0);
      }
      //else {
      //    $('#old-counties-image-wrapper').show();
      //}
     });
  </code></pre>
  
  <p>The else part is commented out for now but is there for browsers that don't support canvas.</p>