2

I am facing this strange issue with my website on Internet Explorer 11. I make Ajax call using pure JS (jquery not an option). It used to work nicely till IE10, and even with IE11 if I remember correctly, and now it won't. It happens with a lot of my users too.

    var xmlhttp;
    alert(window.XMLHttpRequest);
    if (window.XMLHttpRequest) {
        /* IE7+, Firefox, Chrome, Opera, Safari */          
        xmlhttp = new XMLHttpRequest();
    } else { 
        alert('Inside Else');
    }

The above code first alerts 'undefined' and goes to else.

This is an intranet site. My JSPs have the <!doctype html> set, so I believe it would not trigger the compatibility view, also I am not using the X-UA-Compatible meta tag.

I have tried to uncheck the compatibility settings/enterprise mode etc, but no luck.

Any suggestions would be appreciated.

apk
  • 23
  • 5
  • Can check this answer : http://stackoverflow.com/questions/26891783/ie-11-error-access-is-denied-xmlhttprequest Maybe you have the same problem ? – Steeve Pitis Oct 07 '16 at 11:52
  • Or maybe you're running this on IE6/7 mode ? Look your mode on the developper tool. – Steeve Pitis Oct 07 '16 at 11:54
  • Thanks @SteevePitis, the first URL looks like a different issue, when I run in developer mode, it shows default as IE8, may be because intranet turns on the Enterprise mode. But I believe IE8 should still support 'window.XMLHttpRequest' – apk Oct 07 '16 at 12:01
  • Yes it should works with IE8, and what about the quirks mode ? – Steeve Pitis Oct 07 '16 at 12:05
  • I have tried setting the`X-UA-Compatible` to edge with both meta tag and in response header with a servlet filter, but still the result is same. – apk Oct 07 '16 at 12:17
  • Weird thing but no one has written something like `var XMLHttpRequest;` ? – Steeve Pitis Oct 07 '16 at 12:34

0 Answers0