JavaScript bind to hashchange event

Bind a function to the hash change event.

function hashChange() {
    console.info('hash changed!');
}

window.addEventListener('hashchange', hashChange, false);

Comments

Leave a Reply