0

I looked into lot of stackoverflow questions and answers but mine one seems bit different. I am trying to run my application in IE11 with jQuery v1.8.3.

When I try to print $.browser.msie it return undefined. When I print $.browser, i notice property 'Mozilla'.

{
   [functions]: ,
   __proto__: { },
   mozilla: true,
   version: "11.0"
}

I have tried referring jQuery Migrate (jquery-migrate-1.4.1.js) but no luck.

If I try to use (/msie|trident/i).test(navigator.userAgent) is works and return true.

enter image description here

P.S With due respect, I am not looking for identifying IE browser. I am trying to understand the current behavior and any way this could be fixed.

Update:

I noticed that navigator.userAgent is

"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; wbx 1.0.0; rv:11.0) like Gecko"

And then when this function is called, it returns 'Mozilla'

jQuery.uaMatch = function( ua ) {
    ua = ua.toLowerCase();

    var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
        /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
        /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
        /(msie) ([\w.]+)/.exec( ua ) ||
        ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
        [];

    return {
        browser: match[ 1 ] || "",
        version: match[ 2 ] || "0"
    };
};
Shubh
  • 6,693
  • 9
  • 48
  • 83
  • 1
    why do you use this old jquery version? probably it's too old to work properly. – cloned Jul 31 '19 at 12:56
  • 1
    https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie – 4b0 Jul 31 '19 at 12:56
  • Its a legacy application and upgrading jQuery to higher version will be big task. – Shubh Jul 31 '19 at 12:56
  • @Shree : I understand there are other ways to detect IE version and thanks for pointing out but I am trying to understand the current behavior and anyway I can fix it... – Shubh Jul 31 '19 at 12:58

0 Answers0