title: jQuery AJAX - Return dynamic content
body: <p>I am making a jQuery Ajax form submit to a PHP page that I want to return values dynamically instead of all at once. For example, if my jQuery code is:</p>
  
  <pre><code>jQuery.ajax({
        type: "POST",
        url: "$PathToActions/Accounts.php",
        dataType: "html",
        data: "action=register&amp;accounts=" + accounts,
        success: function(response){
             alert(response);
        });
  </code></pre>
  
  <p>My Accounts.php looks something like:</p>
  
  <pre><code>     &lt;?php for ($i = 0; $i &lt; 10; $i++) {
          echo $i;
          sleep(2);
       } ?&gt;
  </code></pre>
  
  <p>My code outputs 012345679 right now in a single JavaScript alert after a ~10 second delay. Is it possible to get it to output the values as soon as they are generated instead of all at once?</p>
  
  <p>Thank you!</p>