jquery.form.js
ajax POST 包含文件域的form表单
1 $("#addPatchsetForm").ajaxSubmit({ 2 target: 'aaa', 3 type: 'post', 4 dataType: 'json', 5 url: "/xxx" , 6 success: function(data){ 7 if(data.status){ 8 $modalInstance.dismiss('cancel'); 9 location.reload(); 10 }else{ 11 alert(data.msg) 12 } 13 }, 14 error: function(XmlHttpRequest, textStatus, errorThrown){ 15 alert( "add patchset error, " + errorThrown); 16 } 17 });