title: Best practices writing JavaScript that uses AJAX call to decide if default action should be prevented
body: <p>I'm using JavaScript and jQuery to write a handler for my form being submitted. Based on certain conditions, the handler may allow or prevent the form from submitting.</p>
  <p>This is straight forward but is made more complex by the fact that the handler needs to make an AJAX call.</p>
  <p>The issue is that my handler will return right away with true or false, but I won't get the response from the AJAX call until later. But I need the result from the AJAX call to decide what the return value should be.</p>
  <p>Seems like this must surely be a common scenario. Are there best practices for handling this case?</p>