Not sure what is the problem with below code, somehow i am not able to get blockUI() working.
$.ajax({
url : "before",
type : "POST",
dataType : "text",
async : true,
data : formData,
beforeSend : function() { $.blockUI({ message: 'OK' }); },
success : function(response) {
$.unblockUI();
alert("Congrats! Success!");
var successUrl = "after";
window.location.href = successUrl;
return false;
},
error : function(jqXHR, textStatus, errorThrown) {
$.unblockUI();
alert("Oops ! Error occurred !");
}
});// End of ajax
I tried - async : false as well as true.