Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
167
rated 0 times [  174] [ 7]  / answers: 1 / hits: 15839  / 13 Years ago, tue, july 19, 2011, 12:00:00

I want to know if jquery or javascript can detect if the user has pressed the refresh button of their browser? If so can I see an example?


More From » jquery

 Answers
158

window.onunload event will be fired before the page is going to be refreshed.



window.onunload = function(){
alert(unload event detected!);
}

[#91126] Saturday, July 16, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
charity

Total Points: 503
Total Questions: 98
Total Answers: 125

Location: Mali
Member since Fri, Dec 3, 2021
3 Years ago
;