back button disabled Internal linking

240 Views Asked by At

I'm trying to link to parts of my page without having to press the back button multiple times to get out of it.

Is there a simple way of doing this?

I have:

Some Place

That place you just got scrolled to

The url becomes: http://thatsite.com/thatpage.html#someplace

When I press the back button, it becomes: http://thatsite.com/thatpage.html

instead of a different page altogether (ex: http://thatsite.com/thatotherpage.html)

1

There are 1 best solutions below

1
On

It sounds like you're using anchor tags (or hash URL's) to navigate around the website.

You cannot specify which exact page ends up being the "back" page, this is always determined by the browser.

However, you could avoid using named anchor tags by instead using Javascript to use the window.scrollTo method to the correct position.