//判断系统类型
function OSnow(){
var agent = navigator.userAgent.toLowerCase();
var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
if (agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0) {
//your code
alert("这是windows32位系统");
}
if (agent.indexOf("win64") >= 0 || agent.indexOf("wow64") >= 0) {
//your code
alert("这是windows64位系统");
}
if(isMac){
//your code
alert("这是mac系统");
}
}
OSnow();
/**
iOS: function () { var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; return iOS; }, MAC: function () { var agent = navigator.userAgent.toLowerCase(); var MAC = /macintosh|mac os x/i.test(navigator.userAgent) && !window.MSStream; return MAC; }, Android: function () { var android = /Android/.test(navigator.userAgent) && !window.MSStream; return android; },
**/