在window.onLoad函式里使用
function isQyweixin(){
//判斷當前入口是PC端還是APP端
let flag = navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
)==null?false:true;
return flag?is_weixin()?"來自于APP端企業微信":"":is_weixin()?"來自于PC端的企業微信":"來自于PC端瀏覽器";
}
function is_weixin(){
//判斷是在企業微信打開 還是 在瀏覽器打開
return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/126527.html
標籤:AI
上一篇:git to GitHub
下一篇:新人求助,有關于資料流
