How detect “refresh” event with prototype? A Cross-browser solution?
Thanks,
Celso
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no way to detect refreshes in particular, but you can catch the browser before the page gets unloaded (which happens when the user refreshes the page – as well as when they ‘move’ to another page)
In prototype this would look something like this:
If you need to tell the difference, you could always bind some code to the links on your page that disables the above binding so that when the user actively clicks something you know it’s a link (and not a refresh).