방문자의 브라우저 정보 탐색 : Navigator 객체
페이지 정보
작성자 서방님 댓글 0건 조회 180회 작성일 11-08-05 09:22본문
자바스크립트는 브라우저에서 작동한다. 때때로 서버는 브라우저의 정보를 필요로 할 때가 있는데 Navigator 객체가 브라우저의 정보를 제공한다. Navigator 객체는 방문자의 브라우저의 이름, 버전 등등의 정보를 가지고 있는 객체이다.
Navigator 객체 사용 예)
01.
document.write(
"Browser CodeName: "
+ navigator.appCodeName);
02.
document.write(
"<br /><br />"
);
03.
document.write(
"Browser Name: "
+ navigator.appName);
04.
document.write(
"<br /><br />"
);
05.
document.write(
"Browser Version: "
+ navigator.appVersion);
06.
document.write(
"<br /><br />"
);
07.
document.write(
"Cookies Enabled: "
+ navigator.cookie!Enabled);
08.
document.write(
"<br /><br />"
);
09.
document.write(
"Platform: "
+ navigator.platform);
10.
document.write(
"<br /><br />"
);
11.
document.write(
"User-agent header: "
+ navigator.userAgent);
출력 결과)
Browser CodeName: Mozilla
Browser Name: Microsoft Internet Explorer
Browser Version: 4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Cookies Enabled: true
Platform: Win32
User-agent header: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Browser Name: Microsoft Internet Explorer
Browser Version: 4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Cookies Enabled: true
Platform: Win32
User-agent header: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
댓글목록
등록된 댓글이 없습니다.