function is_weixin(){
var ua = navigator.userAgent.toLowerCase(); //判斷瀏覽器的類型
if(ua.match(/MicroMessenger/i)=="micromessenger") {
return true;
} else {
return false;
}
}
if (!is_weixin()) { // 如果不是微信內置瀏覽器,就動態跳轉到以下頁面
window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdf3f22ebfe96b912&redirect_uri=xxx&response_type=code&scope=snsapi_base&state=hyxt#wechat_redirect';
}
js實現只能在微信裏打開鏈接
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.