When I try to use Ext.isIE in IE11 i get false the returning value. And then during the debug my code I see that I get the following error: JavaScript Error - Msg:Invalid argument., my extjs's version is: 4,2
IE 11 is not officially supported prior to ExtJS 4.2.2 (see property isIE11
). Microsoft removed the MSIE
part from IE11's user agent (refer here), which is the reason why it does not work with ExtJS 4.2.1 and below.
From the source code, for ExtJS 4.2.1:
isIE = !isOpera && check(/msie/),
isIE7 = isIE && ((check(/msie 7/) && docMode != 8 && docMode != 9 && docMode != 10) || docMode == 7),
isIE8 = isIE && ((check(/msie 8/) && docMode != 7 && docMode != 9 && docMode != 10) || docMode == 8),
isIE9 = isIE && ((check(/msie 9/) && docMode != 7 && docMode != 8 && docMode != 10) || docMode == 9),
isIE10 = isIE && ((check(/msie 10/) && docMode != 7 && docMode != 8 && docMode != 9) || docMode == 10),
isIE6 = isIE && check(/msie 6/),
and for ExtJS 4.2.2:
isIE = !isOpera && (check(/msie/) || check(/trident/)),
isIE7 = isIE && ((check(/msie 7/) && docMode != 8 && docMode != 9 && docMode != 10) || docMode == 7),
isIE8 = isIE && ((check(/msie 8/) && docMode != 7 && docMode != 9 && docMode != 10) || docMode == 8),
isIE9 = isIE && ((check(/msie 9/) && docMode != 7 && docMode != 8 && docMode != 10) || docMode == 9),
isIE10 = isIE && ((check(/msie 10/) && docMode != 7 && docMode != 8 && docMode != 9) || docMode == 10),
isIE11 = isIE && ((check(/trident\/7\.0/) && docMode != 7 && docMode != 8 && docMode != 9 && docMode != 10) || docMode == 11),
isIE6 = isIE && check(/msie 6/),
It's very simple:
navigator.userAgent.toLowerCase().lastIndexOf('rv:11') > -1
will return true if it's a IE11 browser.
This works for me:
var isIE11 = window.location.hash = !!window.MSInputMethodContext;
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