That's the idea. Take the following user agents for example... [1] Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
[2] Opera/9.00 (Windows NT 6.0; U; en)
[3] Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0) For FF1.5, Opera9 and IE7b respectively. The presence of "Windows NT 6.0" in each case should indicate Windows Vista. But beware that user agents can be faked, so it's not 100%, but I don't think there is anything better?!
----------
고로 아래처럼 하믄 댄다 이거구만요...
if (navigator.userAgent.indexOf("Windows NT 6.0") > -1) {
// Windows Vista
}
단, 위에서도 언급한 것처럼 100% 신뢰하지 마라.. 속일 수 있으니깐.. 머 그래도 순수한 나머지 사용자들을 위해서 서비스 차원에서 구분을 지어야 하는 경우라면 무시해도 될 듯 보임.
|