Building single-page apps with RouteMap.js
I am currently turning a multi-page documentation into an easy to follow step-through guide. The idea is to navigate as you progress and that forthcoming content is filtered on what you have done previously. All happening in a single-page app.
I found found a library that did what I was looking for in RouteMap.js. There are others but this one appealed to me the most.
It allows you to configure callbacks for hashes which are called whenever the appropriate hash is added to the URL. And it allows you to intercept this mechanism so that you can i.e. redirect from one hash to another without calling the first callback.
The only thing I dislike about this library so far is its way to add callbacks as a string of a function name rather than a function. Given this you can not make use of closures or objects…
Other than that it helped me to quickly build a single-page navigation. You can read more about RouteMap.js on the OpenGamma blog.