Jquery.blockUI.js upload rolling wait effect realization thought and code _jquery

Source: Internet
Author: User
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.