I am facing a problem. I have a web page where I use back button anchor link and the code used is ONCLICK="history.go(-1)". The same page has many anchor links and the related sections.
When I go to a page containing back button and click back button immediately, then back button works fine.
If I go to a page containing back button, then hit anchor link that points to a section in the same page and then hit the back button, then it never goes to previous web page, instead goes to the section url.
Maybe you can try a counter that counts how many times a “section” link is clicked
Maybe something like (with jQuery but maybe some kind person will go and change this code to nice plain JavaScript):
And all your section links have a
sectionlinksclass.Then you can do on your back link:
See this fiddle for a demo: http://jsfiddle.net/RRcyF/2/