判断Android系统和iPhone系统 QQ游览器 微信


var ua = navigator.userAgent.toLowerCase();
if (/iphone|ipad|ipod/.test(ua))
{
alert("苹果");

}
else if (/android/.test(ua))
{

alert("安卓");
}android

 

//判断是不是微信浏览器
function isWeiXin(){
var ua = window.navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i) == 'micromessenger'){
  return true;
  }else浏览器

  {
  return false;
  }
}微信

 


//判断是不是QQ游览器
function isqq(){
if(navigator.userAgent.indexOf('QQBrowser') !== -1)
{iphone

return true;//是
}
else
{
return false;//不是

}
}ip

相关文章
相关标签/搜索