<div style="text-align: center; padding-top: 50%;">
<div style="margin-top: 50px; font-size: 40px;">
<span href="javascript:void(0)" id="closeWindow">关闭窗口</span>
</div>
</div>
<script type="text/javascript">
var readyFunc = function onBridgeReady() {
var curid;
var curAudioId;
var playStatus = 0;
// 关闭当前webview窗口 - closeWindow
document.querySelector('#closeWindow').addEventListener('click', function(e){
WeixinJSBridge.invoke('closeWindow',{
},function(res){
//alert(res.err_msg);
});
});
}
if (typeof WeixinJSBridge === "undefined") {
document.addEventListener('WeixinJSBridgeReady', readyFunc, false);
} else {
readyFunc();
}
</script>
在手机微信端,js实现关闭当前网页窗口
最新推荐文章于 2025-02-24 11:48:43 发布