【发布时间】:2016-04-20 21:32:16
【问题描述】:
我有 ajax jquery 文件上传器,它在 Chrome、Firefox 中运行良好,但在 IE 和 Microsoft Edge 上无法运行。它没有给我任何回应,我尝试了所有可能的解决方案,但仍然无法正常工作..
这是我的 JS:
$('form').on('submit', function(event) {
event.stopPropagation();
event.preventDefault();
$.ajax({
url: 'upload.php',
type: 'POST',
data: new FormData(this),
cache: false,
dataType: 'json',
processData: false,
contentType: false,
success: function(data, textStatus, jqXHR)
{
console.log(data)
},
error: function(jqXHR, textStatus, errorThrown)
{
console.log('ERRORS: ' + textStatus);
}
});
});
和我的表格:
<form method="post" enctype="multipart/form-data">
<input name="file[]" type="file" required multiple />
<input type="radio" name="something" value="1"> 1
<input type="radio" name="something" value="2"> 2
</form>
怎么解决!?
【问题讨论】:
-
您是否看到任何控制台错误?在 IE 中?
标签: javascript jquery ajax file-upload internet-explorer-11