Query: After ajax is executed, continue to execute the following code: queryajax

Source: Internet
Author: User

Query: After ajax is executed, continue to execute the following code: queryajax

Jquery waits for the ajax execution to complete and then continues to execute the following code. The specific code is as follows, which is to set the async parameter of the jquery ajax function to false. The default value of this parameter is true:

[Html]View plaincopy
  1. $ (Document). ready (function (){
  2. Loadphpernote ();
  3. Window. open ('HTTP: // www.phpernote.com ');
  4. });
  5. Function loadphpernote (){
  6. Var url = 'HTTP: // www.phpernote.com/ajax.php ';
  7. Var data = 'Action = list ';
  8. JQuery. ajax ({
  9. Type: 'post ',
  10. Url: url,
  11. Data: para,
  12. Async: false, // false indicates that the window. open ('HTTP: // www.phpernote.com ') Statement is executed only after ajax is executed.
  13. Success: function (msg ){
  14. ('{Articlelist'{.html (msg );
  15. }
  16. });
  17. }

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.