Home  >  Article  >  Web Front-end  >  Explanation on the use of ajaxSubmit in Jquery

Explanation on the use of ajaxSubmit in Jquery

巴扎黑
巴扎黑Original
2017-07-03 10:46:361507browse

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

of

document, use ajaxForm to prepare for AJAX submission of the form. The submission action must start with submit
##ajaxSubmit

The form will be submitted immediately by AJAX. You may make this submission under any circumstances.


##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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn