The requested URL:
Copy Code code as follows:
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 synchronizing or asynchronously requesting URLs in Ajax, there is a wait procedure to respond to a request that is returned.
Copy Code code as follows:
Success:function (Request) {onsuccess (request,ismask);},error:function (e) {if (ismask) $ (' #div_mask '). unblock (); Beforesend:function (e) {if (ismask)
$ (' #div_mask '). Block ({message: ' '});
1, here success after the successful return of the response to remove the method ({onsuccess).
2, error is the wrong time to adjust the method (Error:function (e) {if (ismask) $ (' #div_mask '). unblock (); )。 Unblock () is a jquery.blockUI.js method to turn off scrolling when something goes wrong.
3, in the back of the beforesend is in response to send data, start to call the method $ (' #div_mask '). Block ({message: ' '},
Block is a jquery.blockUI.js method that opens the div for scrolling.
Effect Chart: