利用window.navigator.userAgent判断当前是否微信内置浏览器
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                利用window.navigator.userAgent判断当前是否微信内置浏览器
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
                                
                            
                            
                            <!DOCTYPE HTML>
<html lang="en">
<head><meta charset="utf-8"/><title>判斷是否是微信內(nèi)置瀏覽器</title>
</head>
<body><h1>如果用微信瀏覽器打開可以看到下面的文字</h1><p></p>
</body>
</html>
<script type="text/javascript">
window.onload = function(){if(isWeiXin()){var p = document.getElementsByTagName('p');p[0].innerHTML = window.navigator.userAgent;}
}
function isWeiXin(){var ua = window.navigator.userAgent.toLowerCase();if(ua.match(/MicroMessenger/i) == 'micromessenger'){return true;}else{return false;}
}
</script>  
                        
                        
                        ?
轉(zhuǎn)載于:https://www.cnblogs.com/flying607/p/4911741.html
總結(jié)
以上是生活随笔為你收集整理的利用window.navigator.userAgent判断当前是否微信内置浏览器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 集群管理要点
- 下一篇: 算法与数据结构题目的 PHP 实现:栈和
