title: Delay execution of event up the 'event bubble order' until ajax call completes
body: <p>EDIT: in response to comments about executing click event programaticaly on the anchor element, or using, window.open- I can't use these because of the popup blocker. 
  I must allow the original mouseclick event on the anchor by the user to complete its course- resulting in an unblocked new window.</p>
  
  <p>It seems like the best compromise here is to execute a synchronous ajax request- and present the user with a spinner gif until the request completes.</p>
  
  <p>EDIT: fiddle <a href="http://jsfiddle.net/cXdJg/35/" rel="nofollow noreferrer">http://jsfiddle.net/cXdJg/35/</a></p>
  
  <p>Consider the case of a web editor with link to a player page.</p>
  
  <p>on click of a link with href set to the player,
  the editor checks if the content has been saved to the server:</p>
  
  <p>if yes: do nothing.</p>
  
  <p>if not: execute ajax request to save the content.
  on end of the ajax call: allow the click event on the anchor element to continue; leading to execution of request for player page in new browser window.</p>
  
  <p>how is it possible to delay end of the function that intercepts the click event on the anchor element until the ajax call ends, without freezing the browser?
  see <a href="http://www.devcheater.com/#Conclusion" rel="nofollow noreferrer">http://www.devcheater.com/#Conclusion</a></p>
  
  <p>I checked <a href="http://ajaxpatterns.org/Submission_Throttling" rel="nofollow noreferrer">http://ajaxpatterns.org/Submission_Throttling</a>, but do not see how I can apply that example here.</p>
  
  <p>example of the idea in code form:</p>
  
  <pre><code>$('a.play').click(function){
      if(!isSaved){
            save();  //saves the content and **sets isSaved to true**
      }
       while (!isSaved){
            //burn time until isSaved,  but don't freeze the browser!
       }
       //allow the event handler to end, after which the click on anchor element will
       //  load the player page in new window.
  }
  </code></pre>