var ua = navigator.userAgent.toLowerCase()
if (ua.match(/MicroMessenger/i) == "micromessenger") { // 判断是否在微信浏览器内
WeixinJSBridge.invoke('closeWindow', {}, function(res) {
if (res.err_msg == "close_window:ok") {
// 关闭成功的处理
console.log('关闭成功的处理')
} else {
// 关闭失败的处理
console.log('关闭失败的处理')
}
});
}
10-08
4899
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-03
08-01
2873
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-25
1958
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交