Wywołanie:
IsIE() - czy to przeglądarka IE
IsIE(6) - czy to IE6, IE6+ ale nie 7,8
IsIE(7) - czy to IE7, IE7+ ale nie 8
IsIE(8) - czy to IE8, IE8+
function IsIE(nVer)
{
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
if (nVer == null) {
return true;
}
else {
var ieversion = new Number(RegExp.$1)
if ((ieversion >= 8)&&(nVer==8)) return true;
else if ((ieversion >= 7)&&(nVer==7)) return true;
else if ((ieversion >= 6)&&(nVer==6)) return true;
else return false;
}
}
}
Brak komentarzy:
Prześlij komentarz