Browser back button returns me to wrong spot on page.

  • 1
  • Problem
  • Updated 9 years ago
  • Solved
I have a problem with my site remembering and maintaining the scroll position when back-navigating through it using the back button on my browser. When I hit the back button, I expect the previous page to load at the same spot I left off, but instead I go back to the top of the page. I do not have this problem with other sites. Is there something that I can do to fix this?
Photo of Gregg Mattocks

Gregg Mattocks

  • 3 Posts
  • 0 Reply Likes
  • frustrated

Posted 9 years ago

  • 1
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
You have to add code if you want it to go back to the same point. You notice not all sites go back to the point you were at.

I think its some kind of anchor code but im not sure.

When you use anchors it works. Try my site, click 1 of the small ABCDEF.. links to move down the page, then click a business category, when you click back you will see you are taken to the same point.

There is probably a way to do it without anchors, but i dont know how.

Lee. http://hexham.info/business
Photo of Gregg Mattocks

Gregg Mattocks

  • 3 Posts
  • 0 Reply Likes
Thanks, Duke.

I see what you are saying. If I first click from your business page on the letter "O" for instance, I am taken to http://www.hexham.info/business.php#a13. Then if I click on "Opticians", I am taken to that page. Hitting my back button from there returns me to http://www.hexham.info/business.php#a13. However, if I simply go to your business page and scroll down to "Opticians," click on that link, and then hit my back button, I am returned to the top of the business page, not where I had scrolled down to. I notice that other sites don't do this. I think it may be some type of script issue, and I barely know HTML, so I think I may be out of luck for the time being.

Thanks so much for your advice, and maybe I can work some anchor tags into my site that will increase the likelihood of a user hitting the back button and being returned to approximately where he or she left off.

Sincerely,

Gregg
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Hi Gregg, i have been doing a bit more research on this.

From what i can see you either use anchors or some kind of server side script which remembers where you were on the page... Or add or delete something from the CSS of the page.

What i did also discover was it works normally on IE. In Internet Explorer when vieing a Yola site it returns you to the same point of the page but on firefox it does not. I had never noticed that before. But on Ebay for example it works on both browsers.

Lee.
Photo of Gregg Mattocks

Gregg Mattocks

  • 3 Posts
  • 0 Reply Likes
Lee,

Thanks once again for addressing my concern. I normally use Firefox and that is why I have been noticing this problem. I have in the past checked my still-new site on IE just to be sure it was formatting o.k. but had not checked IE to see how it performed on this particular issue. I believe most folks still use IE, so this shouldn't be an issue for them. That is great to know.

Thanks again for all your help. I appreciate it.

Gregg
Photo of Frostbytez

Frostbytez

  • 180 Posts
  • 3 Reply Likes
@The Duke,
if you click on a link at you command it to go to a certain section such as
www.example.com/example#13 that would be going to whatever you command it to scroll to. This happends to me too, It treats it as if its another page and when you press back it goes to the same page but at the top.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
I understand that Frostbytez, the thing here is, if you just scroll down the page on IE then click a link and then click back it takes you to the point in the page you were at, if you do the same thing in Firefox it takes you to the top of the page.

From my research the most likely cause is it has something to do with the page CSS.

Lee.