Monitor all AJAX requests on the page

Source: Internet
Author: User

Monitor all AJAX requests:

Do you have a problem with this: the page launches two AJAX requests, hoping that they all succeed, and then do an action?
The easy-to-think solution is to wait until one of these ends and then launch another, which is done with a callback function.
However, if one of the AJAX request code is not you write, you can not change, how to do?
Or, you just want to know when a URL request is over, don't want to call another request, how to do it?

<! DOCTYPE html>

Other related functions:

In $.ajax

Error: Called when an error occurs and can be used to escalate an incorrect request.

Complete: Both success and failure will be called

In the high version:

$.promise

$.when

Monitor all AJAX requests on the page

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.