Jump to content

Anchor Links Break Browser's Back Button

Recommended Posts

So here's a weird one... on our beer menu, clicking on a beer will take you to another page dedicated to that beer. Then you hit back in your browser and it'll take you back to the menu. It works, hooray! Also, all of the anchor links at the top ("Light & Refreshing" through "To-Go Beer") work great and scroll you down to the correct place on the page.  Double hooray!

However, these two things don't work together. As in, if you click an anchor link at the top AND THEN click on a beer to go to its page, at that time when you click back in the browser, rather than going back to the beer menu like you'd expect, it takes you to our home page. It's not even the top of our home page, it's about halfway down where no anchor links even exist. Super weird. This is happening on Safari on my MacBook as well as on Safari on my iPhone 15 however it works fine on Chrome on the same computer as well as on a coworkers PC.

Anyone have any insight here?

 

 

Link to comment
  • Replies 4
  • Views 738
  • Created
  • Last Reply

Top Posters In This Topic

20 hours ago, NewTerrainBrewing said:

So here's a weird one... on our beer menu, clicking on a beer will take you to another page dedicated to that beer. Then you hit back in your browser and it'll take you back to the menu. It works, hooray! Also, all of the anchor links at the top ("Light & Refreshing" through "To-Go Beer") work great and scroll you down to the correct place on the page.  Double hooray!

However, these two things don't work together. As in, if you click an anchor link at the top AND THEN click on a beer to go to its page, at that time when you click back in the browser, rather than going back to the beer menu like you'd expect, it takes you to our home page. It's not even the top of our home page, it's about halfway down where no anchor links even exist. Super weird. This is happening on Safari on my MacBook as well as on Safari on my iPhone 15 however it works fine on Chrome on the same computer as well as on a coworkers PC.

Anyone have any insight here?

 

BrokenAnchorLinks.mov 15.76 MB · 0 downloads  

 

BrokenAnchorLinks.mov

Can you share your URL so I can check it easier?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace (+100 Spark plugin customisations)
🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.