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.
window.navigator have different properties which contains following information like-
Write the code to get browser details as shown below-
HTML:
After that, attach the jquery library link and write the below javascript code in head part as shown below-
JS:
Now save the file and run on browser to get all useful browser information.
Result (your browser detail):
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. |
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):
Browser Name = Netscape
Full Version = 5
Major Version = 5
Browser Engine Name = Gecko
Browser Application Name = Netscape
Browser Application Code Name = Mozilla
Browser Application Version = 5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Browser User Agent = Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Browser Platform(OS) = Linux x86_64
Browser Language = en-US
Is Browser Online = true
Is Cookie Enabled = true
Is Java Enabled = false
Full Version = 5
Major Version = 5
Browser Engine Name = Gecko
Browser Application Name = Netscape
Browser Application Code Name = Mozilla
Browser Application Version = 5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Browser User Agent = Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Browser Platform(OS) = Linux x86_64
Browser Language = en-US
Is Browser Online = true
Is Cookie Enabled = true
Is Java Enabled = false
0 comments:
Post a Comment