March 17, 2011
Chek Windows Vista using Javascript
Question by Pankaj
how can i found Windows Vista Service Pack version using javascript..
Answer by Starx
By using Javascript try
alert(navigator.userAgent));
However I am not sure if, it is cross browser. Better way would be to use server side languages.
By using PHP, you can do this.
<? echo $_SERVER['HTTP_USER_AGENT']; ?>
Both, Javascript and PHP outputs something like this
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
You can detect the OS using this output as Windows NT 6.1 is Windows 7