Link section within page with slash (/) and not hash (#) without reloading the page

You can use history.pushState to change the browser URL without reloading a page, and jQuery’s scrollTop method to scroll to the top of a specific element (and there are VanillaJS equivalents too). This will mimic the functionality of # anchors.

However, like what Mark said, what your client wants is really weird. It is hard to maintain and keep working, and it might even hurt your client. Here’s a case study that you might want to show him/her.

Leave a Comment