Method of asynchronous submission form

The form of asynchronous will encounter submission record:


Form an asynchronous commit points:
In the A. forms name must be like the name of the receive parameters in Java.
The number of parameters in the B. forms submitted to, multi parameter receiving a number java. No more and no less, otherwise don't submit to.


$.post('addshipaddress.html', $('form#addressForm').serialize(), function(data){
alert(data);
}, 'text');
(1): url //The addshipaddress.html form is submitted to where

(2): The data parameter here is the transfer form parameter $('form#addressForm').Serialize) (note that you cannot use single quotes

Such as the $('form#addressForm').Serialize ()' is wrong


(3): function(data)The callback function and a method to see the following wording.. Another wrote a function function


$.post('addshipaddress.html', $('form#addressForm').serialize(), function(data){
confirmSuccess(data);
}, 'text');

}

function confirmSuccess(data) {
alert(data);
window.location.reload();
}

(4): Text you want to return the form, can be XML, JSON, text, type


There are other ways to submit..... To be continued. . . . .

Posted by Lareina at December 02, 2013 - 9:44 AM