Home > Article > Web Front-end > What is the principle of ajax?
Jesse James Garrett, the earliest proposer of the concept of Ajax, believes that Ajax is the abbreviation of Asynchronous JavaScript and XML.
Ajax is not a new language or technology. It is actually several technologies combined in a certain way to play their respective roles in common collaboration. , it includes:
1) Standardized rendering using XHTML and CSS;
2) Dynamic display and interaction using DOM;
3) Data exchange using XML and XSLT and processing;
4) Use XMLHttpRequest for asynchronous data reading;
5) Finally use JavaScript to bind and process all data;
The working principle of Ajax is equivalent to An intermediate layer is added between the user and the server to make user operations and server responses asynchronous. Not all user requests are submitted to the server. Some data verification and data processing are left to the Ajax engine itself. Only when it is determined that new data needs to be read from the server, the Ajax engine will submit the request to the server on its behalf.
Although Garrent lists 7 Ajax constituent technologies, I personally believe that the core of the so-called Ajax is only JavaScript, XMLHTTPRequest and DOM. If the data format used is XML, XML can also be added. (The data returned by Ajax from the server can be in XML format or other formats such as text).
In the old interaction method, the user triggers an HTTP request to the server, and the server processes it and then returns a new HTHL page to the client. Whenever the server processes a request submitted by the client, The client can only wait idle, and even if it is just a small interaction and only needs to get a simple piece of data from the server, a complete HTML page must be returned, and the user has to waste time and bandwidth to re-read it every time. Take the entire page.
The above is the detailed content of What is the principle of ajax?. For more information, please follow other related articles on the PHP Chinese website!