title: JQuery - force multiple ajax requests to run in sequence
body: <p>The following executes each ajax call using jQuery in sequence.  The calls must be in sequence.  The only way I've found this works is by using async: false, which I know is deprecated and should not be used.  The code below loops through each element in the [name] array and fires each ajax request in sequence.  When I remove async: false, the ajax calls are made out of sequence and sometimes one of them does not seem to fire at all.  I thought ajaxComplete might help me here but I've had no luck.  Is there a way to make these ajax calls fire in sequence?</p>
  
  <pre><code>function doGetJson(name1) { 
      var URL = 'http://some url/?name=' + name1;
      $.ajax({
          url : URL,
          dataType : 'jsonp',
          async: false,
          jsonpCallback : 'getJson',
          name: name1,
          index: i,
          success : handleJson
      });
  };
  
  function handleJson(data) {
      &lt;...some other operations...&gt;
  
  };
  
  var name = "test1,test2,test3".split(",");
  
  for (var i = 0; i &lt; name.length ; i++ )
  {
      doGetJson(name[i]);
  }
  </code></pre>