Share Ajax Create simple instance code _ajax related

Source: Internet
Author: User

XMLHTTP is a set of APIs that can be routed through HTTP protocols or receive XML and other data from a scripting language such as JavaScript, VbScript, JScript, and so on. The biggest use of XMLHTTP is that you can update portions of a Web page without refreshing the entire page. Almost all browsers support the XMLHttpRequest object, which is the core technology of AJAX applications. The
JS code is as follows:

 

The above JS Code section explains:
(1). the onReadyStateChange property of the XMLHttpRequest object that is required to perform a task when the request is sent to the server. Whenever the readyState changes, the onReadyStateChange event is triggered.
(2). the ReadyState property of the XMLHttpRequest object, which holds the XMLHttpRequest State (0~4).

    • 0: Request not initialized
    • 1: The server connection has been established
    • 2: Request received
    • 3: In Request processing
    • 4: The request is complete and the response is ready

(3). Open (Method,url,async) method : Specify the type of request, URL, and whether the request is processed asynchronously.
(4). Send (content) sends a request to the server.

The above is the Ajax to create a simple instance code, I hope to help you learn, you can also create a simple example of Ajax.

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.