title: jQuery ajax beforeSend
body: <p>I have a simple AJAX call that is executing a function on the <code>beforeSend</code> and on <code>complete</code>. They execute fine but the <code>beforeSend</code> is "seemingly" not executed until after the success.</p>
  
  <p>On the <code>beforeSend</code> there is a "Please wait" notification. If I put a break after the function in the <code>beforeSend</code> then it will show that notification and then hit the success. Without the break point then it will sit there and think while waiting for the response and then my please wait notification will appear for a fraction of a second after the success is hit.</p>
  
  <p>The desired functionality is to have the notification appear as soon as the request is sent so it displays while it is waiting for the response.</p>
  
  <pre><code>        $.ajax({
              type : 'POST',
              url : url,
              async : false,
              data : postData,
              beforeSend : function (){
                  $.blockUI({
                      fadeIn : 0,
                      fadeOut : 0,
                      showOverlay : false
                  });
              },
              success : function (returnData) {
                  //stuff
              },
              error : function (xhr, textStatus, errorThrown) {
                  //other stuff
              },
              complete : function (){
                  $.unblockUI();
              }
          });
  </code></pre>