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?
window.onunload event will be fired before the page is going to be refreshed.
window.onunload = function(){ alert("unload event detected!"); }