Some personal understanding of Ajax

Source: Internet
Author: User
Tags object html page http request client
Ajax

Ajax is not a new language or technology, it is actually a combination of several technologies in a certain way to play their role in the same collaboration, it includes

Standardized rendering using XHTML and CSS;
Use DOM to implement dynamic display and interaction;
Data exchange and processing using XML and XSLT;
Using XMLHttpRequest for asynchronous data reading;
Finally, bind and process all data with JavaScript;

In the old interaction, the user triggers an HTTP request to the server, the server processes it, returns a new HTHL page to the client, and every time the server processes a client-submitted request, the client can only wait, and even if it is only a small interaction, By simply getting a very simple piece of data from the server, you return a full HTML page, and the user wastes time and bandwidth each time to reread the entire page.

With Ajax, the user will quickly respond to the wait without the page overload from feeling almost all the operations.

Ajax works by adding a middle tier between the user and the server, enabling the user to respond asynchronously to the server. Not all user requests are submitted to the server, such as data validation and processing, which are given to the Ajax engine itself, and the Ajax engine submits requests to the server (mainly reading XML-formatted data) when it is necessary to read new data from the server.
And one of the biggest features of Ajax is that it is possible to transfer or read data to the server without refreshing the page (also known as no Refresh Update page), which mainly benefits from the XMLHTTP component XMLHttpRequest object. This can be sent to the desktop application only with the server data level exchange, and do not refresh the interface every time without each time the data processing to the server to do, which is to reduce the burden of the server and accelerate the response speed, shorten the user waiting time.

The first application XMLHTTP is Microsoft, ie by allowing developers to use XMLHTTP ActiveX components within a Web page to extend their functionality, developers can transfer data directly to or from the server without navigating from the current Web page. This feature is important because it helps to reduce the pain of stateless connections, and it also eliminates the need to download redundant HTML, thereby increasing the speed of the process. Mozilla responds by creating its own inherited XML proxy class: the XMLHttpRequest class. Konqueror (and Safari v1.2, also a khtml based browser) also supports XMLHttpRequest objects, and opera also supports v7.6x+ objects in later versions of XMLHttpRequest. For most cases, XMLHttpRequest objects are similar to XMLHTTP components, and methods and properties are similar, except that a small subset of properties are not supported.

Report:
The application of XMLHttpRequest object in JS
var xmlhttp = new XMLHttpRequest ();
The application of Microsoft's XMLHTTP component in JS
var xmlhttp = new ActiveXObject (microsoft.xmlhttp);
var xmlhttp = new ActiveXObject (msxml2.xmlhttp);



Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.