javascript判断ie浏览器版本号

msie = int((/msie (d+)/.exec((navigator.userAgent).toLowerCase()) || [])[1]);
/* IE 11改变了它的userAgent格式,所以要进一步判断 */
if (isNaN(msie)) {
    msie = int((/trident/.*; rv:(d+)/.exec((navigator.userAgent).toUpperCase()) || [])[1]);
}