title: Remove fragment in URL with JavaScript w/out causing page reload
body: <p><strong>Background:</strong> I have an HTML page which lets you expand certain content. As only small portions of the page need to be loaded for such an expansion, it's done via JavaScript, and not by directing to a new URL/ HTML page. However, as a bonus the user is able to permalink to such expanded sections, i.e. send someone else a URL like</p>
  
  <p><em><a href="http://example.com/#foobar" rel="noreferrer">http://example.com/#foobar</a></em></p>
  
  <p>and have the "foobar" category be opened immediately for that other user. This works using parent.location.hash = 'foobar', so that part is fine.</p>
  
  <p><strong>Now the question:</strong> When the user closes such a category on the page, I want to empty the URL fragment again, i.e. turn <a href="http://example.com/#foobar" rel="noreferrer">http://example.com/#foobar</a> into <a href="http://example.com/" rel="noreferrer">http://example.com/</a> to update the permalink display. However, doing so using <code>parent.location.hash = ''</code> causes a reload of the whole page (in Firefox 3, for instance), which I'd like to avoid. Using <code>window.location.href = '/#'</code> won't trigger a page reload, but leaves the somewhat unpretty-looking "#" sign in the URL. So is there a way in popular browsers to JavaScript-remove a URL anchor including the "#" sign without triggering a page refresh?</p>