thank you in advance
So if you want to persist some value - ie the state of your counter - then you will need to store it somewhere and load it up again when the page is loaded.
The counter needs to be per user of course otherwise everyone will get the same value! So one option could be a cookie and another could be to store it on a server somewhere but that depends what technologies you are using, is your user signed in etc.
Hope that helps.
Or load your pages dynamically via AJAX (plus HTML5 History API) in a container (div) and place the counter oustide this container.
Look at this demo. Audio player keeps on playing and URL changes while navigating between content. This library really rocks!
If it is a countdown you can use Date() since the countdown is from a specific time then when you refresh the page it will show the countdown according to the time left.
Some websites which may help: