Jquery.blockUI.js implementation of upload scrolling wait effect

Source: Internet
Author: User

  Requested URL:
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 you synchronize or asynchronously request a URL in Ajax, there is a wait procedure when you want to respond to a request that is returned.
Success:function (Request) {onsuccess (request,ismask);},error:function (e) {if (ismask) $ (' #div_mask '). Unblock () ;},beforesend:function (e) {if (Ismask)
$ (' #div_mask '). Block ({message: ' '});}
1, where success is followed by a method that is removed after a successful return response ({onsuccess).
2, error is the wrong time to tune 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 invoke the method $ (' #div_mask '). Block ({message: ' '},
block is a jquery.blockUI.js method,Open the div for scrolling.
Effects 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.