使用ajax提交form表单时,$("formId").serialize()不能提交type="file"类型的input,这个时候可以选择使用FormData,使用方法如下

var dataForm = new FormData(document.getElementById("queryForm"));
$.ajax({ processData: false,//这个必须有,不然会报错
contentType: false,//这个必须有,不然会报错
type: "POST",
url:"/trail/shopdeepupload",
data:dataForm,
async: false,
dataType:"json" ,
success: function(data) { if(data=="false"){
showTipPanel("上传失败,请重试!");
}
if(data=="true"){
showTipPanel("上传成功!");
setInterval(retFun(),1000);
}
}
});

 

TypeError: 'append' called on an object that does not implement interface FormData 解决方法的更多相关文章

  1. ajax上传图片报错TypeError: 'append' called on an object that does not implement interface Fo

    使用FormData时报错:TypeError: 'append' called on an object that does not implement interface FormData 解决办 ...

  2. TypeError: 'stepUp' called on an object that does not implement interface HTMLInputElement.

    我今天写程序的时候遇到的问题,开始完成功能后没发觉.当再次部署程序更新时候,出的错误,通过firebug发现提示是TypeError: 'stepUp' called on an object tha ...

  3. python 报错TypeError: 'range' object does not support item assignment,解决方法

    贴问题 nums = range(5)#range is a built-in function that creates a list of integers print(nums)#prints ...

  4. Warning: count(): Parameter must be an array or an object that implements Countable in line 302解决方法

    ytkah在调试项目时又弹出一个警告Warning: count(): Parameter must be an array or an object that implements Countabl ...

  5. error while loading shared libraries: libg2o_core.so: cannot open shared object file: No such file or directory解决方法

    在build文件夹目录环境下输入: sudo ldconfig 然后编译就可以了.因为g2o刚装,没生效.

  6. cannot open shared object file: No such file or directory解决方法

  7. 【Selenium】【BugList8】126邮箱定位不到“退出”按钮:Message: TypeError: can't access dead object

    [流程描述] 登录126邮箱,退出 [代码] #coding=utf-8 from selenium import webdriver driver = webdriver.Firefox() #dr ...

  8. Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法

    发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站  小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...

  9. for遍历用例数据时,报错:TypeError: list indices must be integers, not dict,'int' object is not iterable解决方法

    一:报错:TypeError: list indices must be integers, not dict for i in range(0,len(test_data)): suite.addT ...

随机推荐

  1. ubuntu环境下安装Redis

    1.命令行安装 sudo apt-get update sudo apt-get install redis-server 2.启动redis $redis-server :C Aug ::42.26 ...

  2. Tensorflow中的命名空间scope

    1.name_scope 在tensorflow中有两种声明变量的方式,tf.get_variable()和tf.Variable(). name_scope对于tf.get_variable()无效 ...

  3. jedis中的一致性hash算法

    [http://my.oschina.net/u/866190/blog/192286] jredis是redis的java客户端,通过sharde实现负载路由,一直很好奇jredis的sharde如 ...

  4. 直方图均衡化的 C++ 实现(基于 openCV)

    这是数字图像处理课的大作业,完成于 2013/06/17,需要调用 openCV 库,完整源码和报告如下: #include <cv.h> #include <highgui.h&g ...

  5. element-ui中tabs页设置第一个页面不可关闭

    element官网中,有说明添加这个属性,默认为false,但是这个是一个单属性,似乎没法赋值. 这个用css就行了嘛,没必要搞得那么复杂,也不需要设置close属性,按照官网的示例文档即可.css设 ...

  6. vue配置stylus

    首先Vue-init webapck 随便一个name vue项目创建好之后 cnpm i  (利用淘宝镜像) cnpm i stylus stylus-loader -D 进行安装和配置 styl常 ...

  7. LeetCode Number of Longest Increasing Subsequence

    原题链接在这里:https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/ 题目: Give ...

  8. bzoj 3709: [PA2014]Bohater 贪心

    题目: 在一款电脑游戏中,你需要打败\(n\)只怪物(从\(1\)到\(n\)编号).为了打败第\(i\)只怪物,你需要消耗\(d_i\)点生命值,但怪物死后会掉落血药,使你恢复\(a_i\)点生命值 ...

  9. webpack里CommonJS的require与ES6 的module.exports加载模块有何不同

    只需明白commonjs的规则即可,import会被转化为commonjs格式的,babel默认会把ES6的模块转化为commonjs规范的. import vue from 'vue'; //等价于 ...

  10. win8.1系统相关

    win8.1系统相关 信息时代,系统更新速度非常快,十一月初,同事在网上花5元买了一个win8.1系统激活码,之后两周,我电脑由于系统故障,准备重装系统,借助他的系统,但无法激活,借用他购买的账号也不 ...