JS判断当前操作系统

时间:2016-01-06 00:19:07   收藏:0   阅读:332

function validataOS(){

 

if(navigator.userAgent.indexOf(“Window”)>0){

return ”Windows”;

 

}else if(navigator.userAgent.indexOf(“Mac OS X”)>0) {

return ”Mac ”;

 

}else if(navigator.userAgent.indexOf(“Linux”)>0) {

return ”Linux”;

 

}else{

return ”NUll”;

}

}

原文:http://www.cnblogs.com/niwalala/p/5104063.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!