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:
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With