javascript detect # in url
<p>My application is an iframe app so when the user changes page they do not automatically get taken to the top. To combat this on page load I call </p>

<pre><code>window.location.hash = 'tophash'
</code></pre>

<p>I have found however on some rare cases I need to take the user to a specific part of the page. So I make a url with #anotherID on the end. Problem is currently they are taken to tophash on page load.</p>

<p>What I need is if there is a hash within the url it does not run <code>window.location.hash = 'tophash'</code></p>

<p>So my question is... how do I detech the presence of a # in the url?</p>
