I have a simple AJAX call that is executing a function on the beforeSend
and on complete
. They execute fine but the beforeSend
is \"se
This is most probably because of async : false
. As your call is synchronous,
after your call to the $.ajax()
function begins, nothing happens until the response is received, and the next thing as far as your code goes will be the success
handler
To make it work, You can do something like this
$.blockUI({
fadeIn : 0,
fadeOut : 0,
showOverlay : false
});
// and here goes your synchronous ajax call
$.ajax({
type : 'POST',
url : url,
async : false,
data : postData,
success : function (returnData) {
//stuff
},
error : function (xhr, textStatus, errorThrown) {
//other stuff
},
complete : function (){
$.unblockUI();
}
});