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.
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"
};
};