开发者

How to run a javascript when browser process is killed?

开发者 https://www.devze.com 2023-01-02 07:41 出处:网络
I hav onUnload=\"cleanup()\" defined in my html body tag. The cleanup() method in javascript is f开发者_如何学Pythonunction cleanup()

I hav onUnload="cleanup()" defined in my html body tag. The cleanup() method in javascript is

f开发者_如何学Pythonunction cleanup() {--clean up session--}.

But when the browser is terminated by killing the process using task manager, I want to do the same action as cleanup. How can this be done?


You cannot. If the process is forcefully killed, nobody cares about your scripts.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号