<div class="codetitle"> <span><a style="CURSOR: pointer" data="99811" class="copybut" id="copybut99811" onclick="doCopy('code99811')"><u>코드 복사</u></a></span> 코드는 다음과 같습니다.</div> <div class="codebody" id="code99811"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><head id="Head1" runat="server"> title></title> <br></head> <br><script type="text/javascript"> <br>function browserinfo() { <br>var Browser_Name = navigator.appName; <br>var Browser_Version = parsFloat(navigator.appVersion); <br>var Browser_Agent = navigator.userAgent; <br>var Actual_Version, <br>var is_IE = (Microsoft Internet Explorer "); //IE 브라우저인지 확인<br>var is_NN = (Browser_Name == "Netscape"); //넷스케이프 브라우저인지 확인<br>var is_op = (Browser_Name == "Opera") ; / /Opera 브라우저인지 확인 <br>if (is_NN) { <br>//상위 5.0을 처리해야 하며 하위 5.0은 직접 반환 <br>if (Browser_Version >= 5.0) { <br>if (Browser_Agent.indexOf("Netscape") != -1) { <br>var Split_Sign = Browser_Agent.lastIndexOf("/"); <br>var Version = Browser_Agent.lastIndexOf(" ")>var Bname = Browser_Agent.substring (0, Split_Sign); <br>var Split_sign2 = Bname.lastIndexOf(" "); <br>Actual_Version = Browser_Agent.substring(Split_Sign 1, Browser_Agent.length) <br>Actual_Name = Bname.substring(Split_sign2) 1, Bname .length); <br>} <br>if (Browser_Agent.indexOf("Firefox") != -1) { <br>var Split_Sign = Browser_Agent.lastIndexOf("/"); = Browser_Agent.lastIndexOf(" "); <br>Actual_Version = Browser_Agent.substring(Split_Sign 1, Browser_Agent.length); <br>Actual_Name = Browser_Agent.substring(버전 1, Split_Sign) <br>if ( Browser_Agent.indexOf ("Safari") != -1) { <br>if (Browser_Agent.indexOf("Chrome") != -1) { <br>var Split_Sign = Browser_Agent.lastIndexOf(" "); var Version = Browser_Agent.substring(0, Split_Sign); <br>var Split_Sign2 = Version.lastIndexOf("/"); <br>var Bname = Version.lastIndexOf(" "); (Split_Sign2 1 , Version.length); <br>Actual_Name = Version.substring(Bname 1, Split_Sign2) <br>} <br>else { <br>var Split_Sign = Browser_Agent.lastIndexOf("/"); >var Version = Browser_Agent.substring(0, Split_Sign); <br>var Split_Sign2 = Version.lastIndexOf("/"); <br>var Bname = Browser_Agent.lastIndexOf(" "); substring(Split_Sign2 1, Bname); <br>Actual_Name = Browser_Agent.substring(Bname 1, Split_Sign); <br>} <br>} <br>} <br>else { <br>Actual_Version <br> Actual_Name = Browser_Name ; <br>} <br>} <br>else if (is_IE) { <br>var Version_Start = Browser_Agent.indexOf("MSIE"); <br>var Version_End = Browser_Agent.indexOf(";", Version_Start); <br>Actual_Version = Browser_Agent.substring(Version_Start 5, Version_End) <br>Actual_Name = Browser_Name; <br>if (Browser_Agent.indexOf("Maxthon") != -1 || Browser_Agent.indexOf("MAXTHON" ) != -1) { <br>var mv = Browser_Agent.lastIndexOf(" "); <br>var mv1 = Browser_Agent.substring(mv, Browser_Agent.length - 1) <br>mv1 = "여행 버전:" mv1; <br>Actual_Name = "(Maxthon)"; <br>Actual_Version = <br>} <br>} <br>else if (Browser_Agent.indexOf("Opera") != -1) >Actual_Name = "Opera"; <br>var tempstart = Browser_Agent.indexOf("Opera"); <br>var tempend = Browser_Agent.length; <br>Actual_Version = <br>} <br>else >Actual_Name = "알 수 없는 탐색기" <br>Actual_Version = "알 수 없는 버전" <br>} <br>/*------------ -- ------------------------------------------------ -- <br>--네비게이터의 새 속성(Acutal_Name 및 Actual_Version)을 생성할 수 있습니다. -- <br>--사용자: -- <br>--1, 이 함수를 호출합니다. -- <br>--2, 다음과 같은 속성을 사용하십시오:navigator.Actual_Name/navigator.Actual_Version;-- <br>------------------------------- -- ------------------------------------------------ */ <br> navigator.Actual_Name = 실제_이름 <br>navigator.Actual_Version = <br>/*------------------------- -------- ---------------- --- <br>-- 또는 이것을 클래스로 만들었습니다. -- <br>--사용자: -- <br>--1,이 객체의 인스턴스를 다음과 같이 생성합니다:var browser=new browserinfo;-- <br>--2, 다음 인스턴스를 사용합니다:browser.Version/browser.Name -- <br>--------------- ------- --------------*/ <br>this.Name = Actual_Name ; <br>this.Version = <br>} <br>browserinfo() <br>// document.write("사용 중인 브라우저는 다음과 같습니다:" navigator.userAgent) ; <br>//document .write("<br>"); <br>// document.write("사용 중인 브라우저는 " navigator.Actual_Name ", 버전 번호: " navigator.Actual_Version); <br>function closewin() { <br>var type = ""; <br>var ua = navigator.userAgent <br>if (ua.indexOf("MSIE") >= 0) { <br>type = "MSIE"; <br>if (navigator.Actual_Version == "7.0") { <br>type = "7"; <br>} <br>else if (navigator.Actual_Version == "6.0") { <br>유형 = "6" <br>} <br>}<br>else if (ua.indexOf("Firefox") >= 0) { <br>type = "FF"; <br>} <br>if (type == "MSIE6") { <br>window.opener = null; <br>window.close(); <br>} <br>else if (type == "MSIE7") { <br>window.open('', '_top'); <br>window.top.close(); <br>} <br>else if (type == "FF") { <br>window.open('', '_parent', ''); <br>window.close(); <br>} <br>} <br>window.onload = function() { <br>closewin(); <br>} <br></script> <br><input type="button" value="没有提示关闭" onclick="closewin()" /> <br></body> <br></html> <br> </div>