title: Queue Ajax request in Javascript?
body: <p>I would like to execute an Ajax request every seconds. My next code work perfectly.</p>
  
  <pre><code>    window.onload = function () {
          setTimeout(doStuff, 1000); //wait before continuing
      }
  
      function doStuff() {
          $.ajax({
              // ...
          });
          setTimeout(doStuff, 1000);
      };
  </code></pre>
  
  <p>But at this moment if I use a tool like Fiddler to block my request the system continues to send new Ajax request. I would like to queue them and send my next Ajax request only after the answer of my server. How can I do that ?</p>