Before we get to know Ajax, let's take a look at how browsers and servers interact.
1. The browser sends a request to the server
2. The server receives the request information, according to the different situation returns to the browser different information
3. The browser receives the information and outputs it to the current page
The above describes the browser and server interaction simple diagram, you can see in the last step, the browser received information after the content of this page has been updated, but generally we just need to update some of the content, then how to do? So the server simply changes the content of this page to all the browser, so the 2nd step, the server sent to the browser is "how many stars in the sky?" I don't know. "So much content, the browser updates the current page after the results and the results before sending a comparison, only a" I don't know ah "these contents
It's obvious, "How many stars are there in the sky?" "The content is repetitive, is there a way to send only" I don't know "? So the smart programmer just ... Will, stop, we look back to the third step, the browser received information after the current page is unloaded and rewritten, so GA, if the uninstall this step to cancel, rewrite the operation of the change is not OK? So there is a hostage between the browser and the server, he hijacked the information returned by the server, then canceled the browser uninstall operation, and modified the current page, which is the basic principle of Ajax.
To be continued, the detailed usage of Ajax will be updated in a few days and how to be compatible with different browsers