Jqueryajax loading: Wait Until execution ends and continue to execute the following code operation _ jquery

Source: Internet
Author: User
This article mainly introduces the information about Jqueryajax loading, waiting for execution to end, and then continuing to execute the following code operations. If you need it, you can refer to the effect of Jquery waiting for ajax execution to continue to execute the following code, the specific code is as follows. You can set the async parameter of the jquery ajax function to false. The default value of this parameter is true:

$ (Document ). ready (function () {loadphpernote (); window. open ('HTTP: // www.phpernote.com ');}); function loadphpernote () {var url = 'HTTP: // www.phpernote.com/ajax.php'; var data = 'Action = list'; jQuery. ajax ({type: 'post', url: url, data: para, async: false, // false indicates that window is executed only after ajax is executed. open ('HTTP: // www.phpernote.com ') Statement success: function (msg) {condition ('{articlelist'{.html (msg );}});}

The following describes the effect of jquery loading wait.

Var dates = this. options. form. getWidgetByName ("dates "). getValue (); $. ajax ({url: "http: // 127.0.0.1: 9009/Brilliantzz/service/snproduct. do ", data: dates, beforeSend: function () {var h = document. body. clientHeight; $ ("

"Mirror.css ({display:" block ", width:" 100% ", height: h}). appendTo (" body "); $ ("

"Pai.html (" uploading production data. Please wait... "). AppendTo ("body" ).css ({display: "block", left :( $ (document. body ). outerWidth (true)-190)/2, top :( h-45)/2});}, complete: function (data) {$ ('. datagrid-mask-msg '). remove (); $ ('. datagrid-mask '). remove () ;}, success: function (data) {alert ("production data:" + data) ;}, error: function (data) {alert ("An error occurred while uploading production data! ");}});

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.