ajax What is it? ？
It can be used. js Access server , And it's asynchronous access
The response from the server to the client is generally the entire page , One html Full page ！ But in ajax Because it's a partial refresh , So the server doesn't have to respond to the entire page , It's just data .
Asynchronous interaction and synchronous interaction
Sync ： Send a request , Wait for the server's response to end , To send a second request . In the middle of this period is what we often say “ card ”. Refresh the whole page .
asynchronous ： Send a request , No need to wait for a response from the server , Then you can make a second request . have access to js Receive response from server , And then use js To partially refresh .
Ajax advantage ：
1. Increased user experience ：Ajax The biggest advantage is to be able to maintain communication with the server without refreshing the entire page
2. Asynchronous communication with the server ： Communicate with the server asynchronously , Do not interrupt the user's operation
3. Front end and back end load balancing ： Move some back-end work to the front end , Reduce the burden of servers and bandwidth
5. Interface and application separation ：Ajax Separate the interface from the application , That is, the separation of data and presentation
Ajax shortcoming ：
1.Ajax It's gone Back And History function , That is, the destruction of browser mechanism
2. safety problem ：AJAX Technology brings a good user experience to users, but also to IT Enterprises bring new security threats ,Ajax Technology is like building a direct channel for enterprise data . This allows developers to inadvertently expose more data and server logic than before .
3. Weak support for search engines
4. Break the exception handling mechanism of the program
5. Violation URL And the original intention of resource positioning
6. Can't support mobile devices very well
front end Free course ： Alibaba cloud University —— Developer class