コンピュータシステム、およびWindowsはXPであるかどうかを判断

 

//判断浏览器
輸出のconst inBrowser = typeofの窓!== '未定義の' 輸出のconst inWeex = typeofを WXEnvironment!== '未定義の' &&!WXEnvironment.platform 輸出のconst weexPlatform = inWeex && WXEnvironment.platform.toLowerCase() UA constの輸出 = inBrowser && window.navigator.userAgent.toLowerCase() isIE constの輸出 = UA && / MSIE |トライデント/ .TEST(UA) isIE9 constの輸出 = UA && UA.indexOf( 'MSIE 9.0')> 0 isEdge CONSTエクスポート = UA && UA.indexOf( 'エッジ/')> 0 isAndroid CONST輸出 =(UA && UA。indexOf( 'アンドロイド')> 0)|| (weexPlatform === 'アンドロイド' 輸出のconst isIOS =(UA && /iphone|ipad|ipod|ios/.test(UA))|| (weexPlatform === 'IOS' isChrome constの輸出 = UA && /chrome\/\d+/.test(UA)&&!isEdge エクスポートCONST isPhantomJS = UA && / phantomjs / (UA).TEST エクスポートCONST isFF = UA && UA.match(/ Firefoxの\ /(\ D +)/)

 

 

   
//判断窓的系统
するvarバージョン= navigator.userAgent。        もし(!version.indexOf( "Windows NTの5.0")= - 1 ){          警告( "Windows 2000の" );        } それ以外の 場合(version.indexOf( "Windows NTの5.1")= - 1!){          警告( "Windows XPの" );        } それ以外の 場合(version.indexOf( "Windows NTの5.2")= - 1!){          警告( "Windows 2003の" );        } それ以外の 場合(version.indexOf( "Windows NTの6.0")= - !1 ){          警告( "それ以外の 場合(version.indexOf( "Windows NTの6.1")= - 1!){          警告( "Windows 7の" );        } それ以外の 場合(version.indexOf( "Windows NTの6.2")= - 1!){          警告( "Windows 8の" );        } それ以外の 場合(version.indexOf( "Windows NTの10.0")= - 1!){          警告( "窓10" );        }

 

おすすめ

転載: www.cnblogs.com/hill-foryou/p/12524396.html