Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 주식이야기
- Cross
- 도커
- php
- 명사 추출기
- node.js web framework
- 베트남어
- php thumbnail
- Node.js
- C/C++
- rss
- 명사 뽑아내기
- 나의 프로젝트
- flex3
- 디즈니씨
- Lift
- 나의 취미
- ajax
- iBatis
- Eclipse
- 스킨 스쿠버
- 명사 분석기
- nodejs express
- ejb
- 메일왕창보내는법
- ror실행
- docker
- express for node.js
- 책이야기
- scala
Archives
- Today
- Total
nkdk의 세상
JS :: 브라우저 종류 출력 본문
- navigator객체
브라우저의 정보를 알려줍니다.- appCodeName : 브라우저의 코드명을 반환합니다.
- appName : 현재 사용중인 브라우저의 이름을 반환합니다.
- appVersion : 현재 사용중인 브라우저의 버전을 반환합니다.
- mimeTypes : mime형식의 정보를 반환합니다.
- platform : 사용중인 시스템코드를 반환합니다.
- plugins : 플러그인 정보를 반환합니다.
- userAgent : 브라우저의 이름, 버전, 코드를 포함하는 문자열을 반환합니다.
|예제| 익스플로러 5.5의 경우 : Mozilla/4.0 (compatible; MSIE 5.5; Windows 98) - indexOf(문자열) : 문자열중에서 처음에 찾는 문장의 인텍스 번호를 반환합니다.
찾는 문장이 없으면 "-1"을 반환합니다.
<html>
<script language="JavaScript">
<!--
function user_navigator() {
if(navigator.userAgent.indexOf("MSIE 3") != -1)
alert("Internet Explorer 3입니다.");
else if(navigator.userAgent.indexOf("MSIE 4") != -1)
alert("Internet Explorer 4입니다.");
else if(navigator.userAgent.indexOf("MSIE 5") != -1)
alert("Internet Explorer 5입니다.");
else if(navigator.userAgent.indexOf("MSIE 6") != -1)
alert("Internet Explorer 6입니다.");
else
alert("알 수 없는 브라우저입니다.");
}
// -->
</script>
<body onload="user_navigator()"><script language="JavaScript">
<!--
document.write("당신의 브라우저 식별정보 : "+navigator.userAgent);
// -->
</script></body>
</html>