I have a script, similar to this, to block users using Internet Explorer 7 and 8 from accessing my website. I got a message from a customer saying that they were not able to access the website despite using IE 10. I asked the client to go to a website which would allow him to retrieve his user agent and send it to me.
Customers user agent:
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
I'm unsure why the script would block the customer. Below is a small adaptation of the script used to detect the browser version.
//Detect broswer
if (navigator.appName == 'Microsoft Internet Explorer'){
var ua = navigator.userAgent;
var ver = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (ver.exec(ua) != null){
ver = parseFloat( RegExp.$1 );
}
if ( ver > -1 )
{
if ( ver >= 9.0 ){
//msg = "You're using a recent copy of Internet Explorer.";
//alert( msg );
}
else {
$("#inputSection").fadeOut( 'slow', function() {
$("#inputSection").replaceWith(
"We have detected that you are using Internet Explorer version: " + ver +", which is no longer supported. <br>" +
"Please upgrade your browser to the latest version, or use a different browser."
);
});
}
}
}