用于获取系统版本

<script type="text/javascript">
//用于获取系统版本(注意:本方法对Firefox、Chrome无效)
var ua = window.navigator.userAgent;
var osVersion = ua.split(";")[2];
var osV = osVersion.substr(osVersion.length-3,3);
switch(osV)
{
case "5.0":
  document.write("Windows2000");
  break;
case "5.1":
  document.write("WindowsXP");
  break;
case "5.2":
  document.write("Windows2003");
  break;
case "6":
  document.write("Windows Vista");
  break;
case "6.1":
  document.write("Windows 7");
  break;
default:
document.write("Others");
}
</script>

你可能感兴趣的:(windows)