5

关闭微信内置浏览器页面

 1 year ago
source link: https://abcdxyzk.github.io/blog/2023/09/03/lang-web-close/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

关闭微信内置浏览器页面

2023-09-03 15:01:00

https://www.52dianzi.com/category/article/37/607508.html

使用微信内置浏览器打开网页,当操作退出是关闭微信内置浏览器代码如下:

<script type="text/javascript">
	setTimeout(function() {
		//这个可以关闭安卓系统的手机
		document.addEventListener("WeixinJSBridgeReady", function() {
				WeixinJSBridge.call("closeWindow");
			},
			false
		);
		//这个可以关闭ios系统的手机
		WeixinJSBridge.call("closeWindow");
	}, 300);
</script>

还有一种关闭浏览器的方式:微信开发中使用

// WeixinJSBridge.call('closeWindow');

<input type='button' value='关闭' onclick=\"WeixinJSBridge.call('closeWindow');\" />

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK