zoukankan      html  css  js  c++  java
  • 判断电脑的系统,以及windows是否是XP

    //判断浏览器
    export const inBrowser = typeof window !== 'undefined' export const inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform export const weexPlatform = inWeex && WXEnvironment.platform.toLowerCase() export const UA = inBrowser && window.navigator.userAgent.toLowerCase() export const isIE = UA && /msie|trident/.test(UA) export const isIE9 = UA && UA.indexOf('msie 9.0') > 0 export const isEdge = UA && UA.indexOf('edge/') > 0 export const isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android') export const isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios') export const isChrome = UA && /chrome/d+/.test(UA) && !isEdge export const isPhantomJS = UA && /phantomjs/.test(UA) export const isFF = UA && UA.match(/firefox/(d+)/)
       
    //判断windows的系统
    var version = navigator.userAgent;        if (version.indexOf("Windows NT 5.0")!=-1 ) {          alert("windows 2000");        } else if (version.indexOf("Windows NT 5.1")!=-1 ) {          alert("windows xp");        } else if (version.indexOf("Windows NT 5.2")!=-1 ) {          alert("windows 2003");        } else if(version.indexOf("Windows NT 6.0")!=-1){          alert("windows vista");        } else if(version.indexOf("Windows NT 6.1")!=-1){          alert(" windows 7");        } else if(version.indexOf("Windows NT 6.2")!=-1){          alert("windows 8");        } else if(version.indexOf("Windows NT 10.0")!=-1){          alert("windows 10");        }

  • 相关阅读:
    在Linux终端命令行下播放音乐的命令
    危险,几条可致命的Linux命令!
    Linux 之 shell 比较运算符
    Linux-dd命令详解
    vi总结的几个技巧
    用iptables实现代理上网
    CentOS7.5 开启Samba服务
    CentOS7.5常用命令
    CentOS7.5 安装部署Apache+Mysql+Php
    C++入门基础笔记
  • 原文地址:https://www.cnblogs.com/hill-foryou/p/12524396.html
Copyright © 2011-2022 走看看