title: $.when not working for me
body: <p>I have followed all the advice I found here at <a href="https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-request-are-done">Wait until all jQuery Ajax requests are done?</a> but I must be missing something basic.</p>
  
  <p>I have this function...</p>
  
  <pre><code>function ListScores(leaguex, nameid) {
      return $.ajax({
          url: 'sg_ajaxListData.php',
          data: {
              nme: nameid,
              league: leaguex
          },
          dataType: 'json',
          success: function (rows) {
              for (var i in rows) {
                  var row = rows[i];
                  var score1 = row["score1"];
                  var score2 = row["score2"];
                  var round = row["round"];
                  $('#output').append("&lt;br /&gt;Round " + round + " - " + score1);
                  if (leaguex == 'r') {
                      $('#output').append(" " + score2);
                  }
              }
          }
      });
  }
  </code></pre>
  
  <p>It is called from the document.ready function of my code and works perfectly, returning the data and displaying it as expected.
  I want another function to run AFTER ListScores() has displayed its data so, elsewhere in the document.ready function I put...</p>
  
  <pre><code>$.when(ListScores()).done(function(a1){
  console.log("hello",leaguex,nameid, a1);
  });
  </code></pre>
  
  <p>... but nothing ever shows up in the console log so it looks like this function is never being called.
  Am I missing something obvious here?</p>
  
  <p>Thanks
  Steve</p>