|
¹æ¹®ÀÚÀÇ ºê¶ó¿ìÀú È®ÀÎÇϱâ |
../ |
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="1;URL=http://a.b.com/JSno.html">
<SCRIPT LANGUAGE="JavaScript"><!--
var clintAgent = navigator.userAgent;
var clintName = navigator.appName;
if ( clintName.indexOf("Netscape") != -1 ) {
if ( clintAgent.indexOf("Mozilla/4") != -1 )
self.location.href = "NN4.htm";
else
self.location.href = "BelowNN3.htm";
}
else {
if ( clintAgent.indexOf("MSIE 4") != -1 )
self.location.href = "IE4.htm";
else
self.location.href = "BelowIE3.htm";
}
//--></SCRIPT>
</HEAD>
<BODY>
¾È³çÇϼ¼¿ä.. 1ÃÊ ÈÄ ¹æ¹®ÀÚ´ÔÀÇ ºê¶ó¿ìÀú¿¡ ¾Ë¸Â´Â ÆäÀÌÁö·Î °©´Ï´Ù.
</BODY>
</HTML>
²À ÀÌ´ë·Î »ç¿ëÇÒ ÇÊ¿ä´Â ¾ø½À´Ï´Ù. navigator ¿ÀºêÁ§Æ®°¡ Áö¿øÇÏ´Â ¹®ÀÚ¿ Áß¿¡¼
°¢ ºê¶ó¿ìÀú¸¦ ±¸º°ÇÒ ¸¸ÇÑ ¹®ÀÚ¿À» ³Ö¾îÁÖ¸é µË´Ï´Ù.
À§ÀÇ °ÍÀÌ º¹ÀâÇϰí NN4, IE4, NN3ÀÌÇÏ ÀÌ·¸°Ô 3°¡Áö¸¸ ±¸ºÐ ÇÏ·Á¸é °£´ÜÇÕ´Ï´Ù.
if ( document.layers ) self.location.href = "NN4.htm" else if ( document.all ) self.location.href = "IE4.htm" else self.location.href = "BelowNN3.htm"3ÁÙÀÌ¸é µË´Ï´Ù.
À§ÀÇ ¼Ò½º´Â ¹æ¹®ÀÚÀÇ JavascriptÀÇ ¹öÁ¯À» È®ÀÎÇÏ¿© ¹öÁ¯¿¡ ¸Â´Â ÆäÀÌÁö¸¦ °¡Á® ¿É´Ï´Ù. ¸¸¾à, Javascript¸¦ ²¨³õÀº ºê¶ó¿ìÀú´Â 1ÃÊ ÈÄ¿¡ <META> tag¿¡ ÁöÁ¤µÈ ÆäÀÌÁö¸¦ Ãâ·ÂÇÕ´Ï´Ù(load).
À§¿Í °°ÀÌ ¸ðµç ¹öÁ¯º°·Î ÆäÀÌÁö¸¦ ¸¸µç´Ù¸é ¿©·¯ ÆäÀÌÁö¸¦ ÀÛ¼ºÇØ¾ß ÇÕ´Ï´Ù.
À̰ÍÀ» ÇÇÇϱâ À§Çؼ´Â Javascript¸¦ Áß¿äÇÑ ºÎºÐ¿¡¼ÀÇ »ç¿ëÀ» ÇÇÇØ¾ß ÇÕ´Ï´Ù.
¿Ö³ÄÇϸé, Javascript¸¦ ºê¶ó¿ìÀú¿¡¼ ²¨³õÀº »ç¿ëÀÚµµ Àֱ⠶§¹®ÀÔ´Ï´Ù.
Âü°í·Î, ¾Æ·¡´Â <SCRIPT> Åà ¿¡¼ÀÇ ¹öÁ¯º° ºÐ·ùÀÔ´Ï´Ù.
NN2, IE3´Â Javascript 1.0 Áö¿ø
NN3, IE3.02 Javascript 1.1 Áö¿ø
NN4, IE4´Â Javascript 1.2 Áö¿ø
(¹öÁ¯4¿¡¼´Â µÎ ºê¶ó¿ìÀú °£¿¡ ȣȯÀÌ ¾ÈµÇ´Â Object°¡ ÀÖ½À´Ï´Ù.¿¹:layer)
<SCRIPT LANGUAGE="JAVASCRIPT1.2"> Version 1.2 ÀÌ»ó. <SCRIPT LANGUAGE="JAVASCRIPT1.1"> Version 1.1 ÀÌ»ó. <SCRIPT LANGUAGE="JAVASCRIPT"> Version 1.0 ÀÌ»ó.NN3·Î´Â JavaScript1.2 ¸¦ ÀÐÀ» ¼ö ¾ø½À´Ï´Ù. NN4, IE4°¡ ÇÊ¿äÇÕ´Ï´Ù.
ºê¶ó¿ìÀúº° Navigator °´Ã¼ ±¸¼º¿ä¼Ò ¸ðÀ½ |
IE5 (ÇÑ±ÛÆÇ ±âÁØ)
----------------------------------------------
appCodeName = Mozilla
appMinorVersion = 0
appName = Microsoft Internet Explorer
appVersion = 4.0 (compatible; MSIE 5.0; Windows 95: DigExt)
cookieEnabled = true
cpuClass = x86
mimeTypes =
onLine = true
opsProfile =
platform = Win32
plugins =
systemLanguage = ko
userAgent = Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)
userLanguage = ko
userProfile =
-----------------------------------------------
NN4 (¿µ¹®ÆÇ ±âÁØ)
----------------------------------------------
userAgent = Mozilla/4.01 [en] (Win95; I)
appCodeName = Mozilla
appVersion = 4.01 [en] (Win95; I)
appName = Netscape
language = en
platform = Win32
plugins = [object PluginArray]
mimeTypes = [object MimeTypeArray]
----------------------------------------------
IE4 (ÇÑ±ÛÆÇ ±âÁØ)
----------------------------------------------
appCodeName = Mozilla
appMinorVersion = 0
appName = Microsoft Internet Explorer
appVersion = 4.0 (compatible; MSIE 4.0; Windows 95)
cookieEnabled = true
cpuClass = x86
mimeTypes =
onLine = true
opsProfile =
platform = Win32
plugins =
systemLanguage = ko
userAgent = Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)
userLanguage = ko
userProfile =
-----------------------------------------------
NN3 gold (¿µ¹®ÆÇ ±âÁØ)
-----------------------------------------------
userAgent = Mozilla/3.01Gold (Win95; I)
appCodeName = Mozilla
appVersion = 3.01Gold (Win95; I)
appName = Netscape
plugins = [object PluginArray]
mimeTypes = [object MimeTypeArray]
-------------------------------------------------
NN4¿Í IE4ÀÎÁö ±¸º° Çϱâ |
E4 = (document.all) ? true : false
À§´Â IE4À̸é E4=true¸¦ NN4À̸é E4=false¸¦ µ¹·Á ÁØ´Ù. À̰ÍÀº ¾Æ·¡ÀÇ ½ÄÀ¸·Îµµ Ç¥ÇöÇÒ ¼ö ÀÖ´Ù.
N4 = (document.layers) ? true : false
NN4´Â N4=true, IE4´Â N4=false
if( !(document.layers||document.all) ) { DHTMLÀ» Áö¿øÇÏÁö ¾Ê´Â ºê¶ó¿ìÀú NN3, IE3.02ÀÌÇÏ}
ie4, ie5 ±¸º°Çϱâ |
appVersion = 4.0 (compatible; MSIE 5.0; Windows 95; DigExt) appVersion = 4.0 (compatible; MSIE 4.0; Windows 95; DigExt)À§ÀÇ ±¸¹®Àº À§ÀÇ °ÍÀÌ ie5ÀÇ appVersionÀÌ°í ¾Æ·¡ÀÇ °ÍÀÌ ie4ÀÇ °ÍÀÔ´Ï´Ù. ¸Ç¾ÕÀÇ ¹öÀüÁ¤º¸°¡ µÑ´Ù 4.0À¸·Î ³ª¿É´Ï´Ù. ±×·¡¼ ´Ù¸¥ Á¤º¸¸¦ °¡Áö°í ÀÖ´Â ±½Àº ±ÛÀÚµéÀ» È®ÀÎÇØ¾ß ÇÕ´Ï´Ù.
À̰ÍÀ» ÇÏ´Â ¹æ¹ýÀº ¿©·¯°¡Áö°¡ ÀÖ°ÚÁö¸¸ ¾Æ·¡·Î »ç¿ëÇÏ¸é °¡Àå °£´ÜÇÏÁö ¾ÊÀ»±î »ý°¢ÇÕ´Ï´Ù.
var UA = navigator.appName
var ver = navigator.appVersion
if(UA.indexOf("Microsoft") != -1) {
ver = parseInt(ver.split(";")[1].split(" ")[2])
if(ver >= 5) alert("ie5¸¦ »ç¿ëÇÕ´Ï´Ù.")
else if(ver >= 4) alert("ie4¸¦ »ç¿ëÇÕ´Ï´Ù.")
else alert("ie3¸¦ »ç¿ëÇÕ´Ï´Ù.")
}
¿î¿µÃ¼Á¦ ±¸ºÐ Çϱâ |
<HTML><HEAD><TITLE>OSnVR</TITLE><SCRIPT>
function OSnVR(){ // # From JCS("jcSerre@Teaser.fr")
var v = navigator.appVersion.toLowerCase()
theOS = "?" ; theVR = ""
///////////////////// Windows
if( v.indexOf("win")>0 ){
theOS = "Windows"
if( v.indexOf("win95")>0||v.indexOf("windows 95")>0||v.indexOf("win32")>0 ){
theVR=" 95"; return }
if( v.indexOf("win97")>0||v.indexOf("windows 97")>0 ){ theVR=" 97" ; return }
if( v.indexOf("win98")>0||v.indexOf("windows 98")>0 ){ theVR=" 98" ; return }
if( v.indexOf("windows 3.1")>0 ){ theVR=" 3.1" ; return }
if( v.indexOf("win16")>0 ){ theVR=" 3.x" ; return }
if( v.indexOf("windows 3")>0 ){ theVR=" 3" ; return }
if( v.indexOf("winnt")>0||v.indexOf("windows nt")>0 ){ theVR=" NT" ; return }
return
}
/////////////////// MacOS
if( v.indexOf("mac")>0 ){
theOS = "MacOS"
if( v.indexOf("ppc")>0||v.indexOf("powerpc")>0 ){ theVR=" PPC" ; return }
theVR = " 68K"
return
}
///////////////////// X11s
if( v.indexOf("X11")>0 ){
theOS = "X11"
if( v.indexOf("sunos")>0 ){ theVR=" SunOS" ; return }
if( v.indexOf("hp-ux")>0 ){ theVR=" HP-UX" ; return }
if( v.indexOf("linux")>0 ){ theVR=" Linux" ; return }
if( v.indexOf("osf")>0 ){ theVR=" OSF" ; return }
if( v.indexOf("irix")>0 ){ theVR=" Irix" ; return }
if( v.indexOf("aix")>0 ){ theVR=" AIX" ; return }
return
}
/////////////////// OS/2
if( v.indexOf("os/2")>0 ){ theOS="OS/2" ; return }
/////////////////// Craps
if( v.indexOf("webtv")>0 ){ theOS="Web" ; theVR="TV" ; return }
}
OSnVR()
document.write(theOS+theVR)
</SCRIPT></BODY></HTML>