title: jQuery Deferred not working
body: <p>I am trying out a code as </p>
  
  <pre><code>function search(query) {
      var dfr = $.Deferred();
      $.ajax({
          url: "http://search.twitter.com/search.json",
          data: {
              q: query
          },
          dataType: 'jsonp',
          success: dfr.resolve
      });
      return dfr.promise();
  }
  
  Test = {
      start: function(){
          alert("Starting");
      }
  };
  
  function gotresults(data) {
      alert(data.max_id);
  }
  
  function showDiv() {
      $('&lt;div /&gt;').html("Results received").appendTo('body');
  }
  
  $.when(search('ashishnjain'))
      .then(gotresults)
      .then(showDiv);
  </code></pre>
  
  <p>This works as expected. However when I write it as:</p>
  
  <pre><code>Test.start()
      .then(search('ashishnjain'))
      .then(gotresults)
      .then(showDiv);
  </code></pre>
  
  <p>it just alerts "Starting" and terminates.A working example can be found at <a href="http://jsfiddle.net/XQFyq/2/" rel="noreferrer">http://jsfiddle.net/XQFyq/2/</a>. What am I doing wrong?</p>