My understanding about Ajax

Source: Internet
Author: User
Ajax is not a new language or technology. It is actually a combination of several technologies in a certain way to play their respective roles in the same collaboration, including

Use XHTML and CSS for standardized rendering;
Use dom for Dynamic Display and interaction;
Use XML and XSLT for data exchange and processing;
Use XMLHttpRequest for asynchronous data reading;
Finally, use JavaScript to bind and process all data;

In the old interaction mode, the user triggers an HTTP request to the server. After the server processes the request, it returns a new hthl page to the client, each time the server processes a request submitted by the client, the client can only wait idle, and even if it is only a small interaction, it only needs to get a simple data from the server, you must return a complete HTML page, and each time you have to waste time and bandwidth to re-read the entire page.

After Ajax is used, almost all operations will quickly respond to the waiting without page overloading.

The working principle of AJAX is equivalent to adding an intermediate layer between the user and the server, so that user operations and server responses are asynchronous. Not all user requests are submitted to the server, for example, some data verification and data processing are handed over to the Ajax engine, the Ajax engine submits requests to the server only when it is determined that new data needs to be read from the server (mainly to read data in XML format ).
One of the biggest features of AJAX is that it can transmit or read data to the server without refreshing the page (also known as refreshing the new page). This feature mainly benefits from the XMLHTTP component XMLHTTPRequest object. In this way, the desktop application can only exchange data with the server, without refreshing the interface every time or submitting data processing to the server, in this way, the server load is reduced, the response speed is accelerated, and the user waiting time is shortened.

Microsoft was the first to apply XMLHTTP. ie allowed developers to use the XMLHTTP ActiveX component inside the web page to expand their functions, developers can directly transfer data to the server or retrieve data from the server without having to navigate the current web page. This function is very important because it helps reduce the pain of stateless connections. It can also eliminate the need to download redundant HTML, thus improving the process speed. Mozilla responded by creating its own inherited XML proxy class: XMLHttpRequest class. Konqueror (similar to Safari v1.2 and khtml-based browsers) also supports XMLHttpRequest objects, while opera will also support XMLHttpRequest objects in Versions later than v7.6x +. In most cases, the XMLHTTPRequest object is similar to the XMLHTTP component, and the methods and attributes are similar, but a small part of the attributes are not supported.

Appendix:
Application of XMLHttpRequest object in JS
VaR XMLHTTP = new XMLHttpRequest ();
Application of Microsoft XMLHTTP component in JS
VaR XMLHTTP = new activexobject (Microsoft. XMLHTTP );
VaR XMLHTTP = new activexobject (msxml2.xmlhttp );

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.