这段代码可以在客户端检测常用的操作系统类型
//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";