返回顶部

收藏

Javascript 检测用户的操作系统

更多
//OS DETECTION...
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";

var OSVer="Unknown Ver";
if (navigator.appVersion.indexOf("NT 5.1")!=-1) OSVer="XP";
if (navigator.appVersion.indexOf("NT 6.0")!=-1) OSVer="Vista";
if (navigator.appVersion.indexOf("NT 6.1")!=-1) OSVer="7";
if (navigator.userAgent.indexOf("Mac OS X 10.4")!=-1) OSVer="Tiger";
if (navigator.userAgent.indexOf("Mac OS X 10.5")!=-1) OSVer="Leopard";
if (navigator.userAgent.indexOf("Mac OS X 10.6")!=-1) OSVer="Snow Leopard";

标签:检测操作系统,操作系统,浏览器

收藏

0人收藏

支持

0

反对

0