i need to count how many times a user has refreshed a particular page using jquery. The page should have a static counter which will increment every time page reloads and if user navigates to another page counter of previous page should be reset to zero i don’t want use session but do this using only jquery .Please help.
thanks im advance…
There are some hacks that could maybe do this. I’d first ask what user problem you’re really trying to solve because the solution is kind of ugly.
In pseudo-code, this is what you’d do:
The general idea is that you keep a reloadCnt in the cookie and you increment each time. That part is easy.
You also keep a timestamp in the cookie. The timestamp essentially contains the time that the page was last running in this browser (because the page is continually updating the timestamp). If the timestamp is old, then the user’s browser was not just showing this page so this must be the first one in a while. If the timestamp is new, then this is probably just another reload.