title: JQuery TypeError: Type Error
body: <p>I am working on some jquery stuff and ran into this error and I can't figure out how to fix it. I am using the flickr api to view the top 16 photos of the day, and I am doing so using the javascript canvas, but it keeps giving me that error. Here is my code.</p>
  
  <pre><code>var URLs = new Array();
  function draw() {
      // Loop through all images
      var ctx = $('#canvas')[0].getContext("2d");
      for (i=0;i&lt;16;i++){
          //document.write(URLs[i]);
          //alert("hi");
          ctx.drawImage(URLs[i],i * 120,i*120,100,100);
      }
  }
  $.ajax({
      url: 'http://api.flickr.com/services/rest/?&amp;method=flickr.interestingness.getList&amp;api_key=40ebfc18056e62c7e1cbec778b1db727&amp;format=json&amp;jsoncallback=?',
      dataType: "jsonp",
      success:function(data){
          for(var i = 0; i &lt; 16; i++)
          {
              var photoURL = 'http://farm' + data.photos.photo[i].farm + '.static.flickr.com/' + data.photos.photo[i].server + '/' + data.photos.photo[i].id + '_' + data.photos.photo[i].secret + '_m.jpg';
              URLs[i] = photoURL;
          }
          draw();
      }
  })    
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Flickr Art gallery&lt;/title&gt;
      &lt;script src="/js/jquery.js"&gt;&lt;/script&gt;
      &lt;script src="/js/flickr.js"&gt;&lt;/script&gt;
      &lt;style type="text/css"&gt;
        img { display:none; }
        table { margin: 0 auto; }
        td { padding:15px; }
      &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;canvas id="canvas" width="1000" height="600"&gt;&lt;/canvas&gt;
    &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>The error is happening because of the canvas, when I call drawImage, it throws this, so I was wondering what would cause that. Thanks in advance.</p>
  
  <p>The error was :</p>
  
  <pre><code>Uncaught TypeError: Type error 
  d.d.extend._Deferred.f.resolveWith jquery.js:16 
  v jquery.js:16 
  d.ajaxTransport.send.d.onload.d.onreadystatechange jquery.js:16
  </code></pre>