Details about the interaction between browsers and servers in Ajax, and details about ajax
Before learning about Ajax, let's take a look at how browsers interact with servers.
1. the browser sends a request to the server
2. The server receives the request information and returns it to the browser based on different situations.
3. the browser receives the information and outputs it to the current page.
The previous section describes the simple interaction between the browser and the server. In the last step, the browser receives the information and updates all the content on this page, but in general, we only need to update part of the content. What should we do? So the server simply changes the content of this page and sends it to the browser. in step 2, the server sends "How many stars are there in the sky?" to the browser? I don't know. "when there are so many contents, the browser will re-update the results of the current page and compare the results before sending, only" I don't know "more.
Obviously, how many stars are there in the sky? "The content is repeated. Is there a way to send" I don't know? So a smart programmer just needs .... then, stop. Let's look back at Step 3. After the browser receives the information, it uninstalls the current page and overwrites it. so ga. If you cancel this step, isn't it OK to change the rewrite operation to modification? So there is a hijacking between the browser and the server. He hijacks the information returned from the server, cancels the uninstallation of the browser, and modifies the current page. This is the basic principle of Ajax.
The details of Ajax usage and compatibility with different browsers will be updated in a few days.