AjaxSubmit () submits the file, ajaxsubmitfile

Source: Internet
Author: User

AjaxSubmit () submits the file, ajaxsubmitfile

I have checked various methods on the Internet before. If you want to submit a file, you must be able to receive the returned values. We recommend that you use the ajaxSubmit () method.

Most of the recommendations on the Internet are:

$ ("# FormId "). submit ($ (this ). ajaxSubmit ({url :..., type :..., success: function (){...}}); return false; // prevents automatic submission );

However, when using this method, you will find that there will be multiple submissions, one request for the first time, and two requests for the second time .....
The ajaxSubmit () itself has the submit () function, so you don't need to do this, just use:

Var opt = {type: 'post', datatype: 'json', url :'.. /.. /.. /rybmanagement/upLoadFile ', success: function (data ){...}}; $ ("# formId "). ajaxSubmit (opt); // equivalent to from. submit ()

Import file:

<Script src = "jquery-form.js" type = "text/javascript"> </script> <script src = ".../js/jquery-2.1.1.min.js"> </script>

The above is an example of how AjaxSubmit () submits a file. I hope it will help you. If you have any questions, please leave a message and I will reply to you in time. Thank you very much for your support for the help House website!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.