Skip to content

Instantly share code, notes, and snippets.

@brombal
brombal / hashbang.md
Last active May 17, 2016 17:24
hashbang.js provides simple URL monitoring from fragment (hash) changes.

hashbang.js monitors the URL fragment (hashtag) for changes and invokes callbacks when they occur. You can specify a fragment as a string or a regular expression, and callbacks that should be fired when the fragment appears and disappears from the URL.

Examples:

As a complete object, with both plain string and regular expression matches, and 'load' and 'unload' callbacks:

hashbang({