This version is old school.
Please find jQuery plugins on npm.
aciFragment - Store/read URL fragment variables
by Dragos Ursu
aciFragment can be used to store multiple key/value pairs into the fragment part of the URL, it is thus possible to implement interactive widgets that save states into the URL fragment and in - the same time - have the browser history work. aciFragment has basic scroll support (can use animations too), a default API onclick handler (you can call the API method from inside your link onclick handlers) and a custom event you can listen for - even in browsers without 'hashchange' native support.