js 判断是否为mac电脑 、还是windows操作系统

/** * 是否为mac系统(包含iphone手机) * */ 
var isMac = function() { 
return /macintosh|mac os x/i.test(navigator.userAgent); 
}();


/** * 是否为windows系统 * */
var isWindows = function() { 
    return /windows|win32/i.test(navigator.userAgent);
}(); 
原文地址:https://www.cnblogs.com/CyLee/p/6197226.html