window.navigator.platform == "Win32" 判断是在windows机器中
判断浏览器的版本,调用方法:browser.versions.mobile;
var browser={
versions:function(){
var u = navigator.userAgent, app = navigator.appVersion;
return { //version information of mobility
trident: u.indexOf('Trident') > -1, //IE core
presto: u.indexOf('Presto') > -1, //opera core
webKit: u.indexOf('AppleWebKit') > -1, //apple, google core
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //ff core
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //if it is mobile terminal
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios terminal
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android terminal或uc browser
iPhone: u.indexOf('iPhone') > -1 , //if it is iPhone or QQHD browser
iPad: u.indexOf('iPad') > -1, //if it is iPad
webApp: u.indexOf('Safari') == -1 //if it is web application without header and footer.
};
}(),
language:(navigator.browserLanguage || navigator.language).toLowerCase()
};