开发者

Cross browser window close event [duplicate]

开发者 https://www.devze.com 2023-01-02 06:31 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Close /Kills the seesion whenclose the browser or tab
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Close /Kills the seesion when close the browser or tab

Is there a solution for cross browser event. I 开发者_Python百科need to check if user closes their window and to throw an ajax request to my database to sign them out.

I've looked everyone but most cases its not working in all browsers. Anyone have a solution? Or Alternative on how to do this perhaps a conditional statement depending on the browser?

Thanks!


I don't think such a thing exists. You can try an onunload, but that also fires when you refresh the page. This question has been the bane of many that want to do what you're asking for.

0

精彩评论

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

关注公众号