Here are three common ways to submit
Way One
Collect all user input by hand, encapsulate as large "k1=v1&k2=v2 ..." key-value pair form, use $.post (URL, DATA,FN) to submit data to server
$.ajax ({
type: ' Post ',
URL: ' notice_notipsnotice ',
data: ' K1=v1&k2=v2 ... ',
cache:false,
DataType: ' json ',
success:function (data) {
}
Mode two
Single Serialization: $ (' #myform '). Serialize (); The return value is the "K1=v1&k2=v2" key-value pair form, and then the asynchronous request is initiated.
function Notips () {
var Formparam = $ ("#form1"). Serialize ()//Serialization table content is String
$.ajax ({
type: ' Post ' ,
URL: ' Notice_notipsnotice ',
Data:formparam,
cache:false,
dataType: ' JSON ',
success: function (data) {
}
});
Mode three
Ajaxsubmit () functions provided using the jquery form plug-in
$ (' #myform '). Ajaxsubmit ({
type: ' Get/post ',
URL: ' xx.php ',
dataType: ' json ',
SUCCESS:FN,
Clearform:true,
resetform:true
});
This function automatically serializes the selected form and submits it asynchronously
The above article uses the Ajax asynchronous submits the form the several methods summary is small arranges to share to everybody's content, hoped can give everybody a reference, also hoped that everybody supports the cloud habitat community.