如何在 Web 应用程序中捕获浏览器关闭事件? [英] How capture event for browser closing in web applications?

查看:30
本文介绍了如何在 Web 应用程序中捕获浏览器关闭事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当 Web 应用程序运行并关闭浏览器窗口时,会引发哪个事件?

When a web application running and on close the browser window then which event raise?

推荐答案

onunload 是关闭浏览器窗口时引发的事件.

onunload is the event raised when closing the browser window.

如何仅在关闭浏览器时才触发此事件,这只是一种情况.

How ever this event isn't fired only when closing the browser, that's just one case.

这篇关于如何在 Web 应用程序中捕获浏览器关闭事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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