Ajax submission is through JS to submit the request, the request and response by the JS engine to deal with, the page will not refresh, the user does not feel the actual browser issued a request. For example, we want the page to always show the latest news, but do not want to always click the Refresh button, we can use the AJAX mechanism to implement. Online customer service software is also a better example of AJAX requests. The traditional request page will be refreshed, so the limitations are great.
1. Why use Ajax.
With Ajax, the user experience with the web is more "agile": The data submission page does not splash, the page is updated faster, and the network bandwidth is low.
2.AJAX development compared to the traditional mode of the simple place:
In traditional mode, the form submission is redrawn across the page, and more code is needed to keep the page users from changing the form's status. To pass more parameters between the controller and the template to keep the page state. And Ajax is not, because the page is only local update, do not care about the other parts of the page will not affect the content.
3.AJAX development is more difficult than traditional mode:
Need to understand, proficient JavaScript, and JavaScript there are debugging trouble, browser compatibility, and many other obstacles.
=================================
There are several differences:
1. Ajax in the submission, request, receive, are asynchronous, the Web page does not need to refresh; form submission is to create a new page, even if it is submitted to its own page, but also need to refresh;
2. A creates a new request in the background at the time of submission, and the F is to discard this page and then request;
3. A must use JS to achieve, do not enable JS Browser, can not complete the operation; F is the browser's instinct, whether or not to open JS, can submit a form; 4. A when submitting, requesting, receiving, the whole process needs to use a program to process its data; F commits, it is automatically completed according to your form structure, without code intervention.
4. A at the time of submitting, requesting, receiving, the whole process needs to use the procedure to process its data;
f submit, it is based on your form structure automatically completed, do not need code intervention;
when using Easyui, the submission method has a
<li class= "L0" ><span class= "KWD" >function</span><span class= "PLN" > Submitform</span> <span class= "pun" > () {</span></li><li class= "L1" ><span class= "PLN" > $</span ><span class= "pun" > (</span><span class= "str" > ' #ff ' </span><span class= "pun" >). </span><span class= "PLN" >form</span><span class= "pun" > (</span><span class= "str" > ' Submit ' </span><span class= "pun" >) </span></li><li class= "L2" ><span class= " PLN "></span><span class=" pun ">}</span></li>
Submitting in this way is still an AJAX submission, and the string returned in Spring-controller is returned as data, so you can't jump to the page.
So you can only use document.getElementById (""). Submit () is the way to submit the form.
turn from: http://www.cnblogs.com/zhujiabin/p/4901167.html