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(){//發(fā)送前 }, complete: function(){//發(fā)送后 }, success: function(data){//請求成功 }, error: function(response, textStatus, errorThrown){//請求失敗 }});
Chrome瀏覽器不能連續(xù)上傳相同的圖片,第二次無請求,頁面采用jquery.form.js
米脂
2018-09-04 17:09:00