PDA

View Full Version : How to detect if page is refreshed


jharnisch
11-01-2002, 01:39 AM
I would like to know if there is a way I can detect if a page has been refreshed. I would like to stop a user from refreashing a page.

Thanks

Beck
11-01-2002, 02:01 AM
Use Cookies. Some kind of assignment as the page loads, and then it finds that assignment if it ever loads again. I guess you could redirect them if it finds that value you're looking for.

Except it wouldn't be able to detect whether you're returning to the page or just refreshing it. Don't know whether that's important.

beetle
11-01-2002, 03:12 PM
Stop them from refreshing? Why?

And what Beck said is right: You could use cookies....but in the end it would fail, because there is no way to determine the difference between a refresh and a 2nd visit to the page that isn't a refresh. There is no onreload or onrefresh event that can be used either.

In otherwords, you can't do this. The user has every right to refresh a page with his/her browser whenever they want to.