如何检测客户端浏览器/选项卡已关闭 [英] How to Detect the Client Browser/Tab Closed

查看:52
本文介绍了如何检测客户端浏览器/选项卡已关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai all,

如何检测,客户端使用Javascript关闭浏览器/选项卡。

Hai all,
How to Detect, the Client Closed the Browser/Tab using Javascript.

推荐答案

卸载&在这种情况下会触发 beforeunload 事件。
the unload & beforeunload events are fired in that case.


当我刷新页面时,也会触发此事件。我该怎么办?
This events also fired when i Refresh the Page. What i do?


与关闭和重新打开页面一样,是否有效地重新加载?
Isn''t reloading effectively the same as closing and reopening the page?


这篇关于如何检测客户端浏览器/选项卡已关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆