Ajax learning notes (continuously updated)

Source: Internet
Author: User

XMLHTTP. Open (method, URL, bool;
Method: indicates the HTTP request method. There are five methods: Get. Post. Head. Put. Delete. The most common ones are get and post.
URL: The data address. If it is a local file, specify a specific path (for example, extract XML file data); if it is located on another website,

The complete URL of the website.
Bool: Indicates whether to use Asynchronous retrieval. True indicates asynchronous, and false indicates synchronous.
The followingCodeIs a statement that uses an Asynchronous Method to load Baidu website content;
XMLHTTP. Open ("get", "http://www.baidu.com", true );
The following code loads the content of the local data. xml file asynchronously;
XMLHTTP. Open ("get", "data. xml", true );
---------------------
There are 5 status changes in the asynchronous invocation server status.
0 not initialized
1 Initialization
2 send data
3. Data is being transferred
4. asynchronous call completed
---------------------------

 

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.