Team:Korea U Seoul/temp

From 2012.igem.org

(Difference between revisions)
Line 2: Line 2:
<head>
<head>
<script type="text/javascript">
<script type="text/javascript">
-
function getUserAgent() {
+
var Browser = {a : navigator.userAgent.toLowerCase()}
-
      userAgent = new String(navigator.userAgent);
+
Browser = {chrome : Browser.a.indexOf('chrome') != -1}
-
      var versionStr = "none";
+
function whatKindOfBrowser() {if (Browser.chrome) {alert("hey");}
-
  if(userAgent.search("Mozilla/4.0") > -1) {
+
-
      versionStr = "Mozilla/4.0";
+
-
      alert(versionStr);
+
-
  } else {
+
-
      versionStr = "What is yout UA?";
+
-
      alert(versionStr);
+
-
  }
+
}
}
-
 
</script>
</script>
</head>
</head>
-
<body onload="getUserAgent();">
+
<body>
-
    Hi! Your Web Browser Information:
+
<input type="button" value="브라우저 체크" onclick="javascript:whatKindOfBrowser();" />
</body>
</body>
</html>
</html>

Revision as of 17:44, 26 September 2012