我的代码是这样的,成功的结果 msg.d 是未定义的。我认为它与 formdata 作为传递给 jquery ajax 的值有关。但我不知道我能解决它。那有什么问题?!
var files = event.originalEvent.dataTransfer.files; // i get it in drop event
var data = new FormData();
jQuery.each(files, function (i, file) {
data.append('file-' + i, file);
});
$.ajax({
type: "POST",
url: parameters.Url,
contentType: false,
processData: false,
data: data,
success: function (msg) { //my return value from webservice is just "hello"
alert(msg.d);
}
});
}