01 |
function isIE(){ |
02 |
if (!!window.ActiveXObject
|| "ActiveXObject" in window){ |
03 |
return true ; |
04 |
} else { |
05 |
return false ; |
06 |
} |
07 |
} |
08 |
|
09 |
function IEVersion(){ |
10 |
var rv
= -1; |
11 |
if (navigator.appName
== 'Microsoft
Internet Explorer' ){ |
12 |
var ua
= navigator.userAgent; |
13 |
var re
= new RegExp( "MSIE
([0-9]{1,}[\.0-9]{0,})" ); |
14 |
if (re.exec(ua)
!= null ) |
15 |
rv
= parseFloat( RegExp.$1 ); |
16 |
} else if (navigator.appName
== 'Netscape' ){ |
17 |
var ua
= navigator.userAgent; |
18 |
var re
= new RegExp( "Trident/.*rv:([0-9]{1,}[\.0-9]{0,})" ); |
19 |
if (re.exec(ua)
!= null ) |
20 |
rv
= parseFloat( RegExp.$1 ); |
21 |
} |
22 |
return rv; |
23 |
} |
24 |
if (isIE())
{ |
25 |
if (IEVersion()
< 10) { |
26 |
if (IEVersion()
> 7) { |
27 |
window.location.href
= "" ; |
28 |
} else { |
29 |
window.location.href
= "" ; |
30 |
}; |
31 |
}; |
32 |
}; |