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
This function will return the IE major version number as an integer, or undefined
if the browser isn't Internet Explorer. This, like all user agent solutions, is suceptible to user agent spoofing (which has been an official feature of IE since version 8).
function getIEVersion() {
var match = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
return match ? parseInt(match[1]) : undefined;
}