Is there a way to have JavaScript hold any variables through a reload?
If the user hits the reload button, is there any state that is kept by JavaScript, once a page is reloaded?
Is there a way to have JavaScript hold any variables through a reload?
If the user hits the reload button, is there any state that is kept by JavaScript, once a page is reloaded?
Suggestions
Either way, you'll need to write your own read/write methods to store your state.
You will have to utilize cookies to maintain your state. If you're using jQuery I sugest you look into jQuery Cookie:
https://github.com/carhartl/jquery-cookie
Hope this helps you!
small data (2KByte) can be stored in the URL suffix
fragment ID: //host/path#fragment-id
query string: //host/path?query-string
the fragment-id-method is used here:
http://xkcd-map.rent-a-geek.de/
on every dragend-event, the URL is changed
to reflect the current position on the map
special chars mut be urlencode-d
related: hot reloading, reloadable code, figwheel.clj, react.js hot loader