function request(url, onSuccess, paras , method, isAsync, isMask) {
$.ajax({type:method,url:url,async:isAsync,data:paras,success:function(request){onSuccess(request,isMask);},error: function(e) {if(isMask)
$('#div_mask').unblock();},beforeSend:function(e){if(isMask)$('#div_mask').block({message: '
'});}});
}
When requesting url synchronously or asynchronously in ajax , when responding to the returned request, there is a waiting process.
success:function(request){onSuccess(request,isMask );},error:function(e) {if(isMask)$('#div_mask').unblock();},beforeSend:function(e){if(isMask)
$('#div_mask') .block({message:'
'});}
1. What follows success here is Method ({onSuccess) removed after successfully returning the response.
2. Error is the method to adjust when there is an error (error: function(e) {if(isMask)$('#div_mask').unblock();}). unblock() is a method of jquery.blockUI.js, which turns off scrolling when an error occurs.
3. BeforeSend sends data when responding and starts calling the method $('#div_mask').block({message:'
block is the method of jquery.blockUI.js, open the div for scrolling.