Set a variable based on the #of a url -- window.location.hash
<p>so lets say i have a url www.hello.com#one</p>

<p>i know i can grab the has value</p>

<pre><code>var hash = window.location.hash;
alert (hash);
</code></pre>

<p>but rather then write (i know the below is not propper code):</p>

<p>if var hash = one then set var hashValue to 1</p>

<p>else</p>

<p>if var hash = two then set var hashValue to 2</p>

<p>else etc etc</p>

<p>is there a better way to write this.</p>

<p>Cheers</p>
