jquery Ajax has not waited until the success callback to brush off, entered the ONERROR function error case analysis

Source: Internet
Author: User

jquery Ajax has not yet waited for the success callback to be brushed off, into the OnError function error case analysis :

The same request was requested at the same time 2 times, and then the second request to brush off the first time!

(Example: <div onclick= "ajax (URL)" ><a onclick= "Ajax (URL)" > Get Interface Data </a></div>) clicking "Get Interface Data" will trigger the function Ajax (URL) 2 times! That's a problem!

For example, if the shopping cart "add to the Shopping cart" button-style so designed, then each click on the shopping cart, will add two products to the shopping cart!

For example, <input type= "Submit" name= "submit" value= "Login" tabindex= "5"/> To bind the onclick event will be repeated with the form submit!

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.