简体   繁体   English

无法在IE9中提交表单

[英]Unable to submit form in IE9

I have the following code which is doing a javscript post using an XmlHttpRequest: 我有以下代码正在使用XmlHttpRequest进行javscript发布:

var request = new XMLHttpRequest();
var postedFile = document.getElementById("file").files[0];
var formElement = document.getElementById("formID");
var form = new FormData(formElement);

form.append('postedFile', postedFile);
request.open("POST", "/Admin/SaveQuestion/", true);
request.send(form);

This code is working in Chrome, Firefox, IE10, IE11 but I cannot seem to get it to work on IE9. 这段代码可在Chrome,Firefox,IE10,IE11中运行,但我似乎无法在IE9上运行。 Would this have something to do with the posted file or does my issue lie with the XmlHttpRequest? 这与发布的文件有关吗,还是我的问题在于XmlHttpRequest?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM