title: jQuery continue loop when ajax ends
body: <p>I have a loop and I want it to run when ajax ends everytime in the loop.<br>
  Is that possible?</p>
  
  <blockquote>
    <blockquote>
      <p>for (var i=1;i&lt;20;i++){<br>
        if (keepruning = 1) {<br>
      keepruning = 0;</p>
      
      <p>$.post( "getname.php", { id: myarr[i] } )
                    .done(function( data ) {
                      keepruning = 1
                    });</p>
      
      <p>}</p>
    </blockquote>
  </blockquote>
  
  <p>This is as close as I got... and this doesn't work.<br>
  Any help would be very much appriciated;</p>