Im using this piece of code to refresh the page and display a message.
setInterval(function() { alert ("Reloading"),location.reload() },2000);
How would could I save the code so it continues to run after the refresh?
One way is to save current variables (current state) to cookie, and after refresh just loads variables from cookie to your code.