How to trigger an event when hash location changes
<p>I'm trying to trigger an event when the hash changes inside my url using the method <code>onhashchange</code>. I'm calling it, but it doesn't ever seem to get executed.</p>

<p>I've tried the following.</p>

<pre><code>$(function () {
    window.addEventListener("onhashchange", function () {
        alert("Here");
    });

    window.onhashchange = function () {
        alert("Changed");
    }
)};
</code></pre>

<p>is there any reason why these functions aren't being called?</p>