jquery ajax 无刷新上传

时间:2024-11-14 13:37:33
var form = new FormData();
form.append('file', $("#submitmaterials").find("input")[1].files[0]);
$.ajax({
url: server_url + "scbg/doscbg?ajid" + current_case.ajid + "&accessToken=" + accessToken,
type: 'POST',
cache: false,
data: form,
processData: false,
contentType: false,
success: function (data) {
if (data == 'error') { }
}
});