$(window).bind('hashchange', function () -- advice needed
<p>does this look like the best way to get the #value out of the url on change, it does work but just wondering if there was a better way.</p>

<pre><code>$(function () {
    $(window).bind('hashchange', function () {
        var hash = window.location.hash;
        var map = {
            one: 1,
            two: 2,
            three: 3,
            four: 4
        };
        var hashValue = map[hash.substring(1)];
        alert(hashValue);
    });
});
</code></pre>
