How to detect IE11?

When I want to detect IE I use this code: function getInternetExplorerVersion() { var rv = -1; if (navigator.appName == ‘Microsoft Internet Explorer’) { var ua = navigator.userAgent; var re = new RegExp(“MSIE ([0-9]{1,}[\.0-9]{0,})”); if (re.exec(ua) != null) rv = parseFloat( RegExp.$1 ); } return rv; } function checkVersion() { var msg = “You’re not … Read more

Detect IE version (prior to v9) in JavaScript

I want to bounce users of our web site to an error page if they’re using a version of Internet Explorer prior to v9. It’s just not worth our time and money to support IE pre-v9. Users of all other non-IE browsers are fine and shouldn’t be bounced. Here’s the proposed code: if(navigator.appName.indexOf(“Internet Explorer”)!=-1){ //yeah, … Read more

How to detect Safari, Chrome, IE, Firefox and Opera browser?

I have 5 addons/extensions for FF, Chrome, IE, Opera, and Safari. How can I recognize the user browser and redirect (once an install button has been clicked) to download the corresponding addon? 28 s 28 Googling for browser reliable detection often results in checking the User agent string. This method is not reliable, because it’s … Read more

Detecting a mobile browser

I’m looking for a function which return boolean value if user has mobile browser or not. I know that I can use navigator.userAgent and write that function by using regex, but user-agents are too various for different platforms. I doubt that match all possible devices would be easy, and I think this problem has been … Read more