1 <div>
2 <script> 3 // 跳转提示 4 5 if (is_weixn_qq()) {; 6 7 window.location.href = ‘https://c.pc.qq.com/middle.html?pfurl=’+window.location.href; 8 9 } 10 11 function is_weixn_qq(){ 12 13 // 判断当前是否微信/QQ浏览器 14 15 var ua = navigator.userAgent; 16 17 var isWeixin = !!/MicroMessenger/i.test(ua); 18 19 var isQQ = !!/QQ\//i.test(ua); 20 21 if(isWeixin||isQQ){ 22 23 return true; 24 25 } 26 27 return false; 28 29 } 30 31 </script></div>
标签:QQ,qq,微信,JS,var,ua From: https://www.cnblogs.com/mo3408/p/16829509.html