Advertisement
mejpark

JavaScript browser detection demo

May 15th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.59 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5.   <title>JavaScript browser detection demo</title>
  6. </head>
  7. <body>
  8.   <div id="example"></div>
  9.   <script type="text/javascript">
  10.   <!--
  11.  txt = "<p>Browser CodeName: " + navigator.appCodeName + "<\/p>";
  12.  txt+= "<p>Browser Name: " + navigator.appName + "<\/p>";
  13.  txt+= "<p>Browser Version: " + navigator.appVersion + "<\/p>";
  14.  document.getElementById("example").innerHTML=txt;
  15.  //-->
  16.   </script>
  17. </body>
  18. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement