A Understanding Ajax
First Ajax is the full name of asynchronous JavaScript and XML, asynchronous is asynchronous, which is different from the traditional web.
Ii. Basic Concepts
When users browse the Web, whether they open a new comment or fill out a questionnaire, they need to interact with the server repeatedly, but the traditional Web application takes the form of synchronous interaction, that is, the user sends a request to the server, and the Web server performs the corresponding task according to the user's request. and returns the result. This is a very incoherent mode of operation, often need to wait for a long time and the entire page of the refresh, that is commonly referred to as the "white screen" phenomenon, but also the entire page refresh, which increases the user wait time, data duplication and waste a lot of resources and network bandwidth, Ajax uses asynchronous processing to update local content.
Advantages:
(1) Reduce the burden on the server, speed up the browsing speed.
(2) to bring about a better user experience, the traditional white screen phenomenon is very unfriendly, the latter adopt a local refresh, so that users feel is in the
As with desktop applications
(3) based on standardized and widely supported technologies, there is no need to download plugins (Flash) or small programs. (RIA) (4) Further rendering and data separation, the AJAX acquisition server can be fully operational using a separate module, thus enabling the technical
Better division and cooperation between the staff and the artists
Iii. Components of Ajax
Ajax is not a single technology, but a collection of 4 technologies, and the flexibility to use AJAX requires a deep understanding of these different technologies
Common Properties
1.readyState represents the current active phase of the request/response process (0: Uninitialized, the Open method has not been called, 1: Started, the Open method has been called, the Send method has not been called, 2: Sent: Send was called, no response was received, 3: Received, received partial response data ; 4. Complete, can be used on the client)
The value of 2.onreadystatechange readystate is changed once and this method is called once
3.responseText text returned as the response body
4.responseXML XML DOM document that holds response data of response type "Text/xml" or "Application/xml"
HTTP status of the 5.status response
Description of the 6.statusText HTTP status
Iv. Summary
It has the following advantages:
(1) reduce the burden on the server, speed up the browsing speed.
(2) to bring about a better user experience, the traditional white screen phenomenon is very unfriendly, the latter adopt a local refresh, so that users feel is in the
As with desktop applications
(3) based on standardized and widely supported technologies, there is no need to download plugins (Flash) or small programs. (RIA) (4) Further rendering and data separation, the AJAX acquisition server can be fully operational using a separate module, thus enabling the technical
Better division and cooperation between the staff and the artists
Get an initial look at Ajax