Does IE10 support FormData()?

2019-04-28 21:39发布

问题:

I've read (here) that IE10 supports FormData(). But when I type this into the IE10 JavaScript console:

foo = new FormData();

I get the error, "FormData not defined"

Does IE10 support FormData() or doesn't it? Is there a trick to getting it to work in IE10?

回答1:

I can confirm that it does - running your code in the console on this page works fine.

I will therefore hypothesize that you are in Quirks Mode, and therefore the browser is pretending it doesn't know it to be compatible with said Mode.

Make sure your page has a valid <!DOCTYPE html> at the start and no errors to fall back into quirks mode.



回答2:

Also make sure your webserver request "edge" compatibility mode. That may help preventing fallback to older compatibility modes.