How to distinguish an Unload event raised by Refresh or Window Close?

The "Unload" event can be caused by both the "Update" action and the "Close window". is there any way to distinguish an action that actually triggers it? In my situation, I want to ignore the Refresh action. Could you tell me what work is?

I noticed that this type of question already exists, but it seems that all of them have not been resolved. So I raised this question again, and hopefully some smart guy can solve this problem.

+6
javascript events refresh
source share
1 answer

I do not believe that the browser can distinguish between two events.

Both are unload events, and both will call any unload function you made.

+6
source share

All Articles