html:<form id="uploadForm"> <input id="img" class="hidden" type="file" name="file" /></form>脚本:$('#uploadForm').ajaxSubmit({ url: '……', type: 'post', async: true, cache: false, dataType: 'json', contentType: 'multipart/form-data', beforeSend: function(){//发送前 }, complete: function(){//发送后 }, success: function(data){//请求成功 }, error: function(response, textStatus, errorThrown){//请求失败 }});
1 回答

摇曳的蔷薇
TA贡献1793条经验 获得超6个赞
你需要在完成时,重置表单,在请求成功之后 加入
$('input[type=file]').wrap('<form>').closest('form').get(0).reset();
添加回答
举报
0/150
提交
取消