Is there a way to determine that the browser window was closed?

前端 未结 8 391
感动是毒
感动是毒 2021-01-14 12:35

How is it possible to identify that the browser\'s close button was clicked?

8条回答
  •  暖寄归人
    2021-01-14 13:33

    This is a hack but it seems to work for me. It might be IE specific as well. I code for an IE only environment.

    
    

    Edited to add that my unloadFunction opens a popup window that kills the user's session. You can't do anything on the page that was closed itself. 'cause it's closed already! ;)

提交回复
热议问题