Improve your skills

December 15, 2016

How to get browser name, version and other information in javascript with example


In this article, we will discuss about how to get the visitor's browser name, version and other information using window.navigator object in javascript.


get-browser-name-version-and-other-information-in-javascript-jquery-with-example

window.navigator have different properties which contains following information like-

Property Description
Browser Application Name navigator.appName Returns the application name of the browser.
Browser Version navigator.appVersion Returns version information of the browser
Browser Application Code Name navigator.appCodeName Returns the application code name of the browser.
Browser Engine Name navigator.product Returns the product name of the browser engine.
Browser Agent navigator.userAgent Returns the user-agent header sent by the browser to the server Returns the complete information of a browser like name, code name version etc.
Browser Platform navigator.platform Returns the platform of the browser (operating system).
Browser Language navigator.language Returns the language of the browser.
Is Browser Online? navigator.onLine Returns true if the browser is online, otherwise false.
Is Cookies Enabled? navigator.cookieEnabled Returns true if cookies are enabled in the browser, otherwise false.
Is Java Enabled? navigator.javaEnabled() Returns true if Java is enabled in the browser, otherwise false.
Write the code to get browser details as shown below-

HTML:
<body style="background: #E0EDFA; text-align: center; margin-top: 100px;">  
  <div id="dvBrowserInfo"></div>  
</body>

After that, attach the jquery library link and write the below javascript code in head part as shown below-

JS:
  
   Get Browser Name, Version and Other Information in javascript with Example  
    
    
  

Now save the file and run on browser to get all useful browser information.

Result (your browser detail):





0 comments:

Post a Comment

Subscribe for Latest Update

Popular Posts