title: How to do a synchronous json ajax call with jquery
body: <p>I have the following json ajax call:</p>
  
  <pre><code>$.getJSON(server_data.secure_api+'/e/account/check/?callback=?', queryData,
      function(data) {
          has_error = (data.status == 'failure');
  });
  </code></pre>
  
  <p>Which works perfectly, except that it is asynchronous. I now need to make it synchronous, because I need to pause the calling function until has_error is set. How do I do this?</p>
  
  <p>I have already tried using a .ajax call, like this:</p>
  
  <pre><code>jQuery.ajax({
      url:        server_data.secure_api+'/e/account/check/?callback=?',
      data:       queryData,
      DataType:   'jsonp',
      success:    function(result) {
                  has_error = (data.status == 'failure');
              },
      async:      false
  });
  </code></pre>
  
  <p>But it doesn't work! I've tried setting the DataType to json, jsonp, or not set; I've tried including the <code>?callback=?</code> and I've tried leaving it off; none of this has worked. What am I doing wrong?</p>