Ajax was initially proposed by Jesse James Garret of Adaptive Path. 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.
Jesse once said: "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 collaboration of the same community ." It includes:
L use XHTML and CSS for standardized Rendering
L dom for Dynamic Display and Interaction
L XML and XSLT for data exchange and processing
L bind and process all data with JavaScript
Advantages of Using ajax:
1. the fundamental idea of AJAX is to "retrieve data on demand". We can transfer some of the previous server workload to the client and use the idle processing capability of the client to handle it, this reduces the load on servers and bandwidth and saves space and bandwidth rental costs.
2. for better user experience, you can skip page updates and reduce the user's actual and psychological waiting time. Even if you want to read large data, nor will there be a white screen like a refresh. Ajax uses XMLHTTP to send a request to obtain the server response data, and uses JavaScript to operate the Dom to update the page without reloading the entire page, therefore, the reading time is relatively short.
3. Ajax does not require plug-ins or small downloadsProgramIt is widely supported based on standardization and has broad application prospects. It also facilitates future maintenance and modification. Finally, it is convenient to use ajax to call external data. When the page and data are separated, Ajax technology can be used to obtain data to achieve the purpose of separation.
The core of AJAX is the JavaScript Object XMLHttpRequest. This object was first introduced by Microsoft in Internet Explorer 5. It is a technology that supports asynchronous requests. Javascript in the page can obtain data from the server without refreshing the page, or submit data to the server. XMLHttpRequest allows you to use JavaScript to send requests to the server and process responses without blocking users. The emergence of XMLHttpRequest provides a new possibility for web development.
When creating a web site, executing screen updates on the client gives you great flexibility. The following functions can be completed using Ajax:
L dynamically update page data without clicking the "refresh" button
L improve site performance by reducing the volume of data downloaded from the server
L eliminates page refresh for each user input
L directly edit table data, rather than requiring users to navigate to a new page to edit data
Figure 1 Comparison between traditional Web Application Models (left) and Ajax application models (right)
Figure 2 Comparison Between synchronous interaction mode (I) of traditional web applications and asynchronous mode (II) of Ajax applications
Ajax framework