http://jquery.malsup.com/form/#file-upload

在使用jQuery异步上传时,需要注意在存在文件上传时,要将返回数据的contentType设置为text/html,同时返回值应该为字符串

否则,该插件将不能执行参数success中指定回调函数。

原文如下:

To account for the challenges of script and JSON responses when using the iframe mode, the Form Plugin allows these responses to be embedded in a textarea element and it is recommended that you do so for these response types when used in conjuction with file uploads and older browsers.

It is important to note that even when the dataType option is set to 'script', and the server is actually responding with some javascript to a multipart form submission, the response's Content-Type header should be forced to text/html, otherwise Internet Explorer will prompt the user to download a "file".

jQuery ajaxForm和 ajaxSubmit注意的更多相关文章

  1. jQuery form插件的使用--ajaxForm()和ajaxSubmit()的可选参数项对象

    一.前提说明 Form Plugin API 里提供了很多有用的方法可以让你轻松的处理表单里的数据和表单的提交过程. 测试环境:部署到Tomcat中的web项目. 二.简单介绍 本文演示的是:jQue ...

  2. ajax上传图片 jquery插件 jquery.form.js 的方法 ajaxSubmit; AjaxForm与AjaxSubmit的差异

    先引入脚本  这里最好是把jquery的脚本升级到1.7 <script src="js/jquery-1.7.js" type="text/javascript& ...

  3. 如何理解jQuery中的ajaxSubmit方法

    版权声明:本文为博主原创文章,转载请标注:www.cnblogs.com/gdsblog 刚刚学习中,使用到了ajaxSubmit,犹豫以前没有接触㢧这个,所以刚开始是一脸懵逼状态,最后通过查找资料的 ...

  4. form插件ajaxForm和ajaxSubmit方法传递对象参数说明

    form插件的ajaxForm和ajaxSubmit方法的Options对象还可以用来将值传递给jQuery的$.ajax方法.如果你熟悉$.ajax所支持的options,你可以利用它们来将Opti ...

  5. 【jquery】 form ajaxSubmit 问题

    常见问题 这个插件跟哪些版本的jQuery兼容? 这个插件需要jQuery v1.0.3 或 以后的版本. 这个插件需要其它插件的支持吗? 不需要. 这个插件的运行效率高吗? 是的!请到 对比页面 查 ...

  6. 关于form表单提交ajaxForm和ajaxSubmit的用法与区别

    前几天在学习form表单提交时看到这两种方法,这两种方法都是实现form的ajax提交的方法,看了很多资料还是不太明白其用法和区别,最后直接自己写demo,很快就理解,所以说实操是学习的最快捷直接的途 ...

  7. jQuery.form 中的 ajaxForm() 和 ajaxSubmit()

    官方例子  http://malsup.com/jquery/form/#ajaxForm官方API   http://malsup.com/jquery/form/#api中文API   http: ...

  8. jQuery form插件的使用--ajaxForm()和ajaxSubmit()

    转载:https://blog.csdn.net/qq_38602656/article/details/78668924

  9. ajaxForm和ajaxSubmit 粘贴就可用

    <!--To change this template, choose Tools | Templatesand open the template in the editor.-->&l ...

随机推荐

  1. 解决 AttributeError: 'ForeignKey' object has no attribute 're'

    解决办法 # print('rel...',filter_field_obj.re.to.objects.all()) print("rel...", filter_field_o ...

  2. Java 创建一个简单的验证码图片

    代码如下: package lixin.gan.test; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2 ...

  3. locust安装及其简单使用----基于python的性能测试工具

    1.已安装python3.6 ,安装步骤略 pip安装: pip install locust 检查locust是否安装成功 locust --help 2.安装 pyzmq If you inten ...

  4. ckeditor,关于数据回显

  5. ;。【】DAY14、递归,匿名函数

    一.三元运算符 三元运算符也称三目运算符,就是if .....else.....语法糖 前提:if 和 else 只有一条语句 例:a = 20 b = 30 res = a if a > b ...

  6. python之路6-迭代器、生成器、装饰器

    1.迭代器&生成器 列表生成式 现在有个需求,列表[1,2,3,4,5,6,7,,8,9],要求把列表里的每个值加1,如何实现? 方法一: list = [1,2,3,4,5,6,7,8,9] ...

  7. 阿里云短信服务bug

    接入阿里云短信服务,在springboot中写测试方法,执行到 IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou ...

  8. PS中如何提高修改psd图片的效率(自动选择工具)

    在photoshop中制作图片的时候,一般要养成保留psd格式的习惯,纵然普通时候jpg,png格式常用,考虑到以后可能需要修改,也应该备份一下.如果考虑到以后需要修改,可每次成品保存成两个,一个ps ...

  9. mongoDB 集合(表)操作

    mongoDB 集合(表)操作 集合命名规则 使用 utf8 字符(通常不会起中文名字) 不能含有 "\0" 字符 不要以 system. 开头(否咋会覆盖系统集合开头) 不要和关 ...

  10. CF908D New Year and Arbitrary Arrangement(期望Dp+数学)

    题目大意:给你一个空字符串,你有\(\frac{pa}{pa+pb}\)的概率往字符串最后面加个\(a\),\(\frac{pb}{pa+pb}\)的概率往字符串最后面加个\(b\),当子序列\(ab ...