6

In all other non-IE browsers, the following code snippet works great:

<!DOCTYPE html>
<html>
<script type="text/javascript">
var xhr = new XMLHttpRequest();
var url = "https://otherdomain.com";
var method = "GET";
xhr.open(method, url, true);

xhr.onload = function() {
 var responseText = xhr.responseText;
 document.write(responseText);
};

xhr.send()

</script>
</html>

In two different IE11 browsers (running on different OS versions), I get two different errors:

  1. IE11 Win7: Script7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
  2. IE11 Win8: Script7002: XMLHttpRequest: Network Error 0x2eff Could not complete the operation due to error 00002eff

Google searches for the above error codes don't turn up anything useful. I've tried setting Content-Type, adding dummy functions for onprogress and onload, to no avail.

senor_bacon
  • 137
  • 1
  • 1
  • 9
  • 2
    CORS headers are returned correctly from the other domain as evidenced by the fact that the above works fine in other browsers. – senor_bacon Sep 18 '14 at 20:49

1 Answers1

5

Figured it out.

In our case, on a previous project we had changed which SSL protocols were allowed by IE to us. Ajax requests were failing because IE was not allowed to negotiate the SSL handshakes based on the custom configuration.

Solution was to open up Internet Options, choose the Advanced tab, and then click the "Restore Advanced Settings" button. After that the Ajax requests worked fine.

Hopefully this saves someone else the 6 hours or so I spent on this!

senor_bacon
  • 137
  • 1
  • 1
  • 9
  • 6
    After restore setting I applied and close the browser but I didn't work for me. Is there any step missing? – Tushar Paliwal May 06 '16 at 11:19
  • 1
    Any update on this issue, I had the same problem. working in Chrome and Firefox but failing in IE 11 with above error message. This answer didn't work for me either.. – Ramana Dec 27 '18 at 17:27
  • 1
    Any other solution... because we cannot ask all end-users to open IE->Advanced Tab ... – Cherry Jul 07 '19 at 06:10
  • Check related one: https://stackoverflow.com/questions/34049814/ie11-https-ajax-xmlhttprequest-network-error-0x2eff-could-not-complete-the-ope It is bug in Windows or IE – gavenkoa Dec 08 '20 at 19:55