JavaScript Ajax-1 Ajax (Ajax principles, Ajax object properties and methods)

Source: Internet
Author: User

First, the principle of Ajax


Introduction to Ajax

-Asynchronous JavaScript and XML asynchronous JavaScript and XML

-Ajax is a technique used to improve the user experience, essentially by using the XMLHttpRequest object to send requests asynchronously to the server

-The server returns part of the data instead of a full page, changing the local content in the page without refreshing the page


How Ajax Works

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/7D/wKiom1cCIImzMw87AACG0sluUxE183.png "title=" Web.png "alt=" Wkiom1cciimzmw87aacg0sluuxe183.png "/>

Get Ajax objects

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/7A/wKioL1cCIXWTg0WCAAFd7tLlTog464.png "title=" Web.png "alt=" Wkiol1ccixwtg0wcaafd7tlltog464.png "/>


Second, Ajax object properties and methods


Properties and methods for asynchronous objects

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/7A/wKioL1cCIiXw2igvAAImuFRu1QQ644.png "title=" Web.png "alt=" Wkiol1cciixw2igvaaimufru1qq644.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7E/7D/wKiom1cCIanSV730AAFZQ3eZPMA895.png "title=" Web.png "alt=" Wkiom1cciansv730aafzq3ezpma895.png "/>


onReadyStateChange

-onReadyStateChange: Binds an event handler function to handle the ReadyStateChange event

-Note: When the value of the readystate of an Ajax object changes, for example, from 0 to 1, a ReadyStateChange event is generated


ReadyState

-ReadyState: A total of 5 values, respectively, are 0,1,2,3,4, respectively, representing the status of the Ajax object and the server communication

-for example, a value of 4 o'clock indicates that the Ajax object has obtained all the data returned by the server


Summary: This chapter focuses on Ajax (Ajax principles, Ajax object properties and methods)


This article from the "Flying Ants" blog, declined to reprint!

JavaScript Ajax-1 Ajax (Ajax principles, Ajax object properties and methods)

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.