title: jQuery promise().done() is not working
body: <p>jQuery <code>promise().done()</code> is not working. Below is my code:</p>
  
  <pre><code>&lt;div id="testtesttest"&gt;gggggg&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
      Event.observe(window, 'load', function() {
          new Ajax.Request('testurl', {
              method: 'get',
              parameters: {
                  id: param
              },
              onSuccess: function() {
                  alert('success');
                  jQuery('div#testtesttest').html('teststring').promise().done(function() {
                      alert('afterpromise');
                  });
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>It's alerting <strong>"success"</strong>, replacing <strong>"teststring"</strong> with <strong>"gggggg"</strong> but not alerting <strong>"afterpromise"</strong></p>
  
  <p>I am using jquery-1.10.2. </p>
  
  <p>Edited:
  Original code</p>
  
  <pre><code>&lt;?php if (!$this-&gt;getAttributeCode() || $this-&gt;getProduct()-&gt;getData($this-&gt;getAttributeCode())): ?&gt;
      &lt;div id="&lt;?php echo $this-&gt;getBlockId() ?&gt;" class="lazyblocks-loader"&gt;&amp;nbsp;&lt;/div&gt;
      &lt;script type="text/javascript"&gt;
          Event.observe(window, 'load', function(){
              new Ajax.Request('&lt;?php echo $this-&gt;getUrl('lazyblocks/product/' . $this-&gt;getLazyAction()) ?&gt;', {
                  method: 'get',
                  parameters: {
                      id: &lt;?php echo $this-&gt;getProductId(); ?&gt;
                  },
                  onSuccess: function(transport){
                      var data  = transport.responseText;
                      var block = jQuery('#&lt;?php echo $this-&gt;getBlockId() ?&gt;')
                      block.removeClass('lazyblocks-loader');
                      if (data.isJSON()) {
                          var jsonData = data.evalJSON();
                          if (jsonData.html) {
                              block.html(jsonData.html).promise().done(function(){
                                  block.find('img.lazy').jail({
                                      id              : 'page',
                                      event           : 'load+scroll',
                                      loadHiddenImages: true,
                                      offset          : 10000
                                  });
                                  &lt;?php echo $this-&gt;getChildHtml('lazyblocks.loader.oncomplete'); ?&gt;
                              });
                          }
                      }
                  }
              });
          });
      &lt;/script&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>What could be the issue?</p>