I am trying to detect browser that is used by application. This is the code which I am executing.
function checkBrowserType(){
var ua =navigator.userAgent;
alert("browser details ==> " +ua);
}
The strange thing is in various screens I am getting different user agent details. When I try in IE11 one screen it shows
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 10.0; WOW64; Trident/7.0; Touch; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0; wbx 1.0.0)
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0; wbx 1.0.0; rv:11.0) like Gecko
The first one looks fine for me as it gives MSIE search as 25. In that case I can assume the user is using IE. But the the second one says Mozilla/5.0 and 'MSIE' search gives -1 though I am trying in IE. I am not sure what is the real issue with my code. Any one please help me to resolve this.