Home > Article > Web Front-end > Explanation on the use of ajaxSubmit in Jquery
I have been using ajaxForm recently, so I just jot down the usage method for future review.
1, introduce dependency script
//ajaxForm depends on script
< script type="text/javascript" src="/js/jquery/jquery.easyui.min.js">
#2 How to use
##
##
##//Note that $("#testForm") the name in quotation marks must be consistent with the form element id value
3 The difference between ajaxSubmit and ajaxForm
ajaxForm cannot submit the form. In the ready function
ofdocument, use ajaxForm to prepare for AJAX submission of the form. The submission action must start with submit
##ajaxSubmit
##4
option的参数
var options = {
target: '#output1', // target element(s) to be updated with server response
beforeSubmit: showRequest, // pre-submit callback
success: showResponse // post-submit callback
// other available options:
//url: url // override for form's 'action' attribute
//type: type // 'get' or 'post', override for form's 'method' attribute
//dataType: null // 'xml', 'script', or 'json' (expected server response type)
//clearForm: true // clear all form fields after successful submit
//resetForm: true // reset the form after successful submit
// $.ajax options can be used here too, for example:
//timeout: 3000
};
The above is the detailed content of Explanation on the use of ajaxSubmit in Jquery. For more information, please follow other related articles on the PHP Chinese website!