Javascript Router

Note: this post was migrated from my old Tumblr-backed blog

I just made my first release of some code I was working on for the past couple days. It’s a Javascript library whose purpose is to simplify delegation of web requests by leveraging anchor URLs (the data in the trailing # of the URL).

The project has been released under the MIT license.

The advantage of this library is that you don’t need to use CSS selectors to locate your links and attach click actions. Rather, the library will handle any link whose href attribute that starts with a #.

There are 2 classes included in the library:

  • RouterCore – base class that handles routing and automatic handling of links
  • MappingRouter – a simple class that allows for semi-complex delegation of request handling.

See the project github page for additional information and documentation:

https://github.com/spikegrobstein/js_router