$(window).unload is not firing

后端 未结 6 1802
失恋的感觉
失恋的感觉 2020-11-28 15:23

I want to execute an action method when the user is abandoning a particular page using jQuery.

The page has the following code:

    

        
6条回答
  •  被撕碎了的回忆
    2020-11-28 15:27

    jquery .on('unload',..); was not reliable working for me. i switched over to use beforeunload. just make sure you are not returning anything, or the user will get a "are you sure to leave the page"-popup.

    
    

提交回复
热议问题