Ajax (20161110)

Source: Internet
Author: User

<! DOCTYPE HTML Public"-//W3C//DTD XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD">"http://www.w3.org/1999/xhtml">"Content-type"Content="text/html; Charset=utf-8"/><script src="Jquery-3.1.1.min.js"></script><title> Untitled document </title>"Text/javascript">$.ajax ({URL:"1110morningchuli.php",//working with page addressesData:{code:"n001"},//the data passed, the data submittedType"POST",//How to submitDataType:"TEXT",//the type of the return value (there are three types) TEXT POST XML: Extensible Markup Language, usable in, 1, data transfer, used as a data carrierSuccess:function (data) {//callback function, the parameters inside the parentheses are literally named, is actually the return valuealert (data); }, Error:function () {//Handling Error Execution                        }                });</script></body>

Asynchronous processing

Ajax calls by default are asynchronous, high efficiency

Asynchronous refers to the transfer of data regardless of whether the other party receives, direct transmission

Synchronization means that when the data is passed, it must be received before the next data can be transmitted.

For Ajax, it's about executing two threads at a time.

Workaround:
1, turn Ajax into a synchronous
2, put the Add event code inside the AJAX callback function

Ajax (20161110)

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.