Skip to content
Advertisement

Tag: fragment-identifier

Modifying location.hash without page scrolling

We’ve got a few pages using ajax to load in content and there’s a few occasions where we need to deep link into a page. Instead of having a link to “Users” and telling people to click “settings” it’s helpful to be able to link people to user.aspx#settings To allow people to provide us with correct links to sections (for

How to remove the hash from window.location (URL) with JavaScript without page refresh?

I have URL like: http://example.com#something, how do I remove #something, without causing the page to refresh? I attempted the following solution: However, this doesn’t remove the hash symbol # from the URL. Answer Initial question: or both will return the URL without the hash or anything after it. With regards to your edit: Any change to window.location will trigger a

Advertisement