The AJAX submission is to submit the request through JS. The request and response are handled by the JS engine. The page will not be refreshed. The user does not feel that the browser actually sends a request. For example, we hope that the webpage always shows the latest news, and we don't want to always click the refresh button, we can use the AJAX mechanism to implement. The customer service software on the Internet is also a better case requested by AJAX. The traditional request page will be refreshed, so it is limited.
1. Why use AJAX?
Using AJAX, the user's experience of the web will be more "agile": the data submission of the page will not flash the screen; the local update of the page is fast; the network bandwidth occupies low.
2. The simplicity ofajax development than the traditional model:
In the traditional mode, the form submission of the form is re -painted on the entire page. In order to maintain the changes in the state of the page users, there are a lot of code. More parameters should be transmitted between the controller and the template to keep the page status. And Ajax is not, because the page is only local updated, and it will not affect the content of the page of the page.
3.AJAX development is more difficult than traditional models:
You need to understand and proficient in JavaScript, and JavaScript has many obstacles such as debugging trouble and browser compatibility.
============================
There are several differences:
1. When AJAX submits, requests, and receives, it is asynchronous, and web pages do not need to refresh; FORM submission is a new page, even if it is a page submitted to itself, it needs to be refreshed;
2. When a submission, a new request is built in the background; F is to abandon this page, and then the request;
3. A must be implemented using JS. The browser of the JS cannot be used to complete the operation; F is the instinct of the browser. Whether or not you open the JS, you can submit the form; A. A when submitting, requesting, and receiving The entire process needs to be used to process the data; when F is submitted, it is automatically completed according to your form structure, and no code intervention is required.