title: JQuery Ajax success function being called after beforeSend
body: <p>I have the following javascript:</p>
  
  <pre><code>function someFunction(string) {
      $.ajax({
          type: "GET",
          url: "some_endpoint_returning_json",
          async: false,
          data: "param=" + string,
          beforeSend: function() {
              $.blockUI({ message: '&lt;h1&gt;&lt;img src="static/busy.gif" /&gt; Just a moment...&lt;/h1&gt;' });
          },
          complete: function () {
              $.unblockUI();
           },
          dataType: "json",
          success: function(data) {
              window.alert(data.status);
          }
      });
  }
  </code></pre>
  
  <p>I want the UI to block with the included message before sending the ajax request, then remove the message, unblock the ui and then perform the success function.</p>
  
  <p>Currently here is what is happening:</p>
  
  <ol>
  <li>the UI blocks, but doesn't display the message </li>
  <li>The success window alert pops up</li>
  <li>Upon confirming the alert window, the BlockUI message pops up for a split second, then the UI unblocks and the page returns to its initial state</li>
  </ol>