Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to distinguish Unload Event triggered by Refresh or Window Close?

Unload Event can be triggered both by Refresh action and Window Close action. is there a way to distinguish which action that actually trigger it? In my situation, i want to ignore the Refresh action. Could you please give me some insight what the work around is?

I noticed that there is already this sort of question asked, but it seems to they are all unresolved. Therefore i came up this question again and hopefully some intelligent guy can solve this problem.

like image 765
didxga Avatar asked Jun 25 '10 05:06

didxga


1 Answers

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

Both are an unload event, and both will call any unload function that you have made.

like image 69
Naftali Avatar answered Oct 19 '22 22:10

Naftali