Browser Detection In JavaScript

Browser Detection In JavaScript

 
We can Detect the visitor's browser with the help of Navigator Object In JavaScript.
 
Ex:
  1. <html>  
  2.   
  3.    <body>  
  4.       <div id="browserdetection"></div>  
  5.       <script type="text/javascript">  
  6.       x = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";  
  7.       x += "<p>Browser Name: " + navigator.appName + "</p>";  
  8.       x += "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";  
  9.       x += "<p>Browser Version: " + navigator.appVersion + "</p>";  
  10.       document.getElementById("browserdetection").innerHTML = x;  
  11.       </script>  
  12.    </body>  
  13.   
  14. </html> 
Output:
 
juhi.png