Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a web page in which my anchor tags refer to one of the elements within the same page using #id. But this changes my URL as it adds the #id into the suffix. So now when I want to go back to the page from where I came by clicking the back button of the browser, it doesn't go back to the previous page instead it goes back to the hash selections I have made by clicking the anchor tags. Please help me by giving a solution to this.

What I have tried:

I have tried Go to Div with id foo
Posted
Comments
F-ES Sitecore 17-Oct-18 5:06am    
This is standard web behaviour that your users will expect. If you want to "fix" this you'll probably need to manipulate the history via javascript. If you google for the javascript history api you'll find the kind of things you can do

https://css-tricks.com/using-the-html5-history-api
Kornfeld Eliyahu Peter 17-Oct-18 8:47am    
It is an answer not a comment!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900