Question about browser interception of jqueryajax form submit

Source: Internet
Author: User
Normally, jquery's submit form submission will not be intercepted, but the asynchronous submission with jqueryajax will be rejected. Since it is a problem caused by asynchronous submission, it can be solved, because the jqueryajax method provides the parameter option: async

Normally, jquery's submit form submission will not be intercepted, but jquery ajax asynchronous submission will be rejected. Since it is a problem caused by asynchronous submission, it can be solved, because the jquery ajax method provides Parameter options:
Async:
(Default: true) by default, all requests are asynchronous requests. To send a synchronization request, set this option to false. Note: The synchronous request locks the browser. Other operations can be performed only after the request is completed.

$. Ajax ({url: "/member/pay/do_alipay", type: "GET", dataType: "JSON", cache: false, async: false, data: data, success: function (data) {if (data. success) {form. submit ();}}});

In this way, the submit will not be intercepted by the browser.

Related Article

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.