1

how to detect the OS version like windows NT 6.1 will give 6.1, windows NT 5.1 will give 5.1 using javascript

2
  • This may help: stackoverflow.com/questions/11219582/… Commented Mar 27, 2015 at 11:33
  • that is using index of with NT 6.1, but is it possible to get 6.1 without adding it to index of like get version? Commented Mar 27, 2015 at 11:38

2 Answers 2

1

navigator.appVersion will give you Os information.And you can use it as:

document.write(navigator.appVersion);

Sign up to request clarification or add additional context in comments.

Comments

-2

To detect the operating system on the client machine, your script can analyze the value of navigator.appVersion or navigator.userAgent. Below is a simple example of a script that sets the variable OSName to reflect the actual client OS. for example,

 var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";

document.write('Your OS: '+OSName);

1 Comment

The question is specifically asking for the version not the platform.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.