Is it possible to use JavaScript to handle the event of refreshing page?
What I want is get notice if user do one of these behaviours:
- refresh page by pressing F5
- close tab or browser
- enter a new url then press enter on
browser
to display a warning message?
You don’t want the refresh, you want the onbeforeunload event.
http://msdn.microsoft.com/en-us/library/ms536907(VS.85).aspx
Sample code from article