JS判断浏览器打开终端

varUA=function(){varuserAgent=navigator.userAgent.toLowerCase();return{ipad:/ipad/.test(userAgent),iphone:/iphone/.test(userAgent),android:/android/.test(userAgent),weixin:/micromessenger/.test(userAgent),qqnews_version:userAgent.match(/qqnews/i)=="qqnews"?userAgent.split('qqnews/')[1]:''};}