Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6555947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:52:53+00:00 2026-05-25T12:52:53+00:00

Is it possible to display the OS name and version on the page with

  • 0

Is it possible to display the OS name and version on the page with JavaScript?

I am currently using this:

function detectOSAndBrowser() {
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var nameOffset,verOffset,ix;

// In Opera, the true version is after "Opera" or after "Version"
if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
 browserName = "Opera";
}
// In MSIE, the true version is after "MSIE" in userAgent
else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
 browserName = "Internet Explorer";
}
// In Chrome, the true version is after "Chrome" 
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
 browserName = "Google Chrome";
}
// In Safari, the true version is after "Safari" or after "Version" 
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
 browserName = "Safari";
}
// In Firefox, the true version is after "Firefox" 
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
 browserName = "Mozilla Firefox";
}
// In most other browsers, "name/version" is at the end of userAgent 
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) ) 
{
 browserName = nAgt.substring(nameOffset,verOffset);

 if (browserName.toLowerCase()==browserName.toUpperCase()) {
  browserName = navigator.appName;
 }
}
var OSName = "unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) { 
OSName="Windows";
}
if (navigator.appVersion.indexOf("Mac")!=-1) {
OSName="Mac OS X";
}
if (navigator.appVersion.indexOf("X11")!=-1) {
OSName="UNIX";
}
if (navigator.appVersion.indexOf("Linux")!=-1) {
OSName="Linux";
}
if (OSName!=="unknown OS") {
$('#device').html('You\'re using '+browserName+'<br /><div id="OS">on a '+OSName+' computer.</div>');
}
if (OSName=="unknown OS") {
$('#device').html('We were unable to detect your OS and/or browser.');
}

It works, but I want to display the version of the OS and Browser too. This is how it looks right now when I view it:

Screenshot

How could I make it display the version of the browser and OS also?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:52:54+00:00Added an answer on May 25, 2026 at 12:52 pm

    It looks like Quirksmode.org is hosting a very well-thought-through script named BrowserDetect.

    It has specialized search strings to extract the real version number for all major browsers.

    You’re using Chrome 13 on Windows!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to display something other than the definition name in the variables
Is it possible to get class name , and the parameter of that function
is it possible to display start & end times on full calendar latest version?
Possible Duplicate: Storing Smtp from email friendly display name in Web.Config I'm working on
Is it possible to set a display name for a database field, instead of
I want to do something like this: [Display(Name = Plain text. <span class=\red strong\>Red
In JSF is it possible to have a datatable displays records as follows? [Name
is it possible display a 'x' for an html checkbox when we click on
is it possible to display ⇓ entity in ie6? It is being display in
Is it possible to display a view from another controller? Say for example I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.