【发布时间】:2013-12-27 15:25:55
【问题描述】:
以下是我的 Ajax 调用,它在所有浏览器中都可以正常工作,但到目前为止它只在 IE 中出现问题。请告诉我如何使用 Ajax 发布文件,并且发布应该支持 IE 6。
var formData = new FormData(document.getElementById('form'));
$.ajax({
type: "POST",
url: "email.php",
data: formData,
processData: false, // tell jQuery not to process the data
contentType: false, // tell jQuery not to set contentType
success: function(html){
if (html.indexOf("filerror") != -1)
{
alert('error');
}
else if(html.indexOf("true") != -1)
{
alert('true');
}
else if (html.indexOf("false") != -1)
{
alert('false');
}
},
beforeSend:function()
{
}
});
【问题讨论】:
-
为什么你会支持upto IE6 ???
-
作为旁注,查找formData on MDN,滚动到底部查看支持的浏览器,提示:IE 不在该列表中。
-
@adeneo 感谢您的帮助
标签: javascript jquery ajax internet-explorer