title: jquery my done callback gets only called one time i dont get why
body: <pre><code>/**
   * Downloads the fingerprint preview data 
   */
  this.fetchFingerprintPreviews = function (url) {
      var that = this;
      var dfd = jQuery.Deferred();
  
      jQuery.get(url)
          .done(function (resp) {
              var linkNodes = conn.getLinksViaRelation(resp,  
              'http://ws.bdr.de/webhd/hdcap/rels/finger-preview/');
  
              jQuery(linkNodes).each(function () {
                  var link = jQuery(this);
                  var fpIndex = link.prev("index, bdr\\:index").html();
                  var fpType = link.attr('type');
  
                  jQuery.get(link.attr('href'), {"encoding":"base64"}, null, "text")
                      .done(function (imageDataBase64) {
                          fingerprintPreview[fpIndex] = {};
                          fingerprintPreview[fpIndex].imageData = imageDataBase64;
                          fingerprintPreview[fpIndex].type = fpType;
  
                          console.log(fingerprintPreview);
                          if (Object.keys(fingerprintPreview).length == 
                          Object.keys(linkNodes).length) {
                              dfd.resolve();
                          }
                      });
  
              });
          });
  
      return dfd;
  }
  </code></pre>
  
  <p>a new version added which makes use of lexical local variables. still not working.
  m a bit lost at the moment...
  also added a log statement which gets called only one time.
  i would expect the log to get called two times.</p>
  
  <p>any ideas?</p>