简体   繁体   中英

Unable to submit form in IE9

I have the following code which is doing a javscript post using an XmlHttpRequest:

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. Would this have something to do with the posted file or does my issue lie with the XmlHttpRequest?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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