Javascript - How can I check to see if a url is loosely equal to the one in the location bar?
<p><code>function isSameUrl(url){ /*what goes here?*/ }</code></p>

<p>If the current url is <code>http://www.example.com/test#bar</code>, the following would return true: </p>

<pre><code> isSameUrl('#bar')
 isSameUrl('/test#bar')
 isSameUrl('http://www.example.com/test#bar')
</code></pre>

<p>Basically, if the location bar would not change if a link with the specified url was clicked, then it should return true.</p>
