[Script] PC or ¸ð¹ÙÀÏ Á¢¼Ó üũ
ÀÚ¹Ù½ºÅ©¸³Æ®·Î PC ¿¡¼ Á¢¼ÓÇß´ÂÁö, ¸ð¹ÙÀÏ ±â±â·Î Á¢¼ÓÇß´ÂÁö ¿©ºÎ¸¦ °¡¸®±â À§ÇØ ¾Æ·¡¿Í °°ÀÌ Ã³¸®ÇÏ¿´´Ù.
¼Ò½º´Â http://stove99.tistory.com/87 ¿¡¼ Âü°íÇÏ¿´´Ù.
var filter = "win16|win32|win64|mac|macintel"; if( navigator.platform ){ if( filter.indexOf(navigator.platform.toLowerCase())<0 ){ alert("¸ð¹ÙÀÏ ±â±â¿¡¼ Á¢¼Ó"); // ¾Æ·¡ ÁÖ¼Ò·Î À̵¿ÇÑ´Ù. location.href = "http://m.daum.net/";}else{ alert("PC¿¡¼ Á¢¼Ó"); } } |
´ëºÎºÐÀÇ »ç¿ëÀÚµéÀÌ Windows OS À̰ųª MAC OS ÀÏ °ÍÀ̱⠶§¹®¿¡ À§¿Í °°ÀÌ Ã³¸®ÇÏ¿´À¸³ª navigator.platform ·Î ó¸®ÇÏ¿´À» °æ¿ì¿¡ Return µÇ´Â °ªµéÀÌ ¹«¾ùÀÎÁö Âü°í¸¦ ÇØµÎ¸é ´õ ÁÁÀ» °Í °°¾Æ¼ ¾Æ·¡ »çÀÌÆ®¿¡ ÀÖ´ø ³»¿ëÀ» ³ªÀÇ ºí·Î±×¿¡µµ ¿Å°Üº»´Ù.
»çÀÌÆ® ³»¿ë ÀÚü¸¦ º¹»çÇؼ ³Ö¾úÀ¸³ª ¿¹»Ú°Ô º¹»çµÇÁö¸¦ ¾Ê¾Æ¼ °¡±ÞÀûÀÌ¸é »çÀÌÆ®¿¡ Á÷Á¢ ¹æ¹®Çؼ º¸±â¸¦ ¹Ù¶õ´Ù.
¿µ¹® »çÀÌÆ®À̱â´Â Çϳª ÁÁÀº ³»¿ëÀÌ ¸¹ÀºµíÇÏ´Ù.
http://www.w3schools.com/jsref/prop_nav_platform.asp
Navigator platform Property
Example
Return the version of your browser:
The result of x will be:
Try it yourself »
Definition and Usage
The platform property returns for which platform the browser is compiled.
Browser Support
The platform property is supported in all major browsers.
Syntax
Return Value
Type | Description |
---|---|
String | The platform of the browser. Possible values:
|
More Examples
Example
A demonstration of all navigator properties in one example:
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Browser Language: " + navigator.language + "</p>";
txt+= "<p>Browser Online: " + navigator.onLine + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
txt+= "<p>User-agent language: " + navigator.systemLanguage + "</p>";
Try it yourself »
Ãâó: https://rainny.tistory.com/171?category=46527 [±àÁ¤Àû »ç°í¹æ½Ä^^]
Ãâó: https://rainny.tistory.com/171?category=46527 [±àÁ¤Àû »ç°í¹æ½Ä^^]