JQueryAjax Request status manager package _ jquery

Source: Internet
Author: User
It is not surprising that a website has asynchronous requests or even many asynchronous requests on a webpage. Ajax has become a necessary basic function for websites, making Web applications more similar to desktop applications. However, no matter how close they are, the client and the server can get one response, there must be a waiting time for loading data. Therefore, most websites use a Gif dynamic icon or 'loading... 'to notify users that data is still being loaded. But sometimes this problem is very complicated and troublesome. You can either display this 'loading' before the ajax request, and then hide it after the ajax is successful, or write it in jquery's ajax global event jQuery. ajaxStart () and jQuery. ajaxStop () to control the ajax status of the entire page. The former method is too trivial to use. Every request must write this 'loading' once, and it must be hidden no matter whether the request succeeds or fails. The latter is global, that is, the Request status of the entire page. Sometimes it cannot meet the requirements of displaying the loading status locally.

To solve these problems, I developed the jQuery plug-in named Ajax Request status manager. Using this plug-in makes loading no longer so troublesome. You can use this plug-in to add and write all requests before triggering ajax requests. All you need to do is to execute the. request () method in user interaction events. You can set all requests on a page to display loading independently or globally (only one loading is displayed ). The following describes how to use the plug-in:

Customize the css style of loading:
. State-loading {background: # fff url (images/icon-ajax-loader.gif )...}

Reference the latest jquery file:

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.