Anchor links not working properly
-
Hi,
I’m having a frustrating problem: My anchor links (fragment links) are not working properly for reasons I don’t understand.
My privacy policy has lots of sections, so I added anchors to help visitors jump to specific sections. I want to be able to let people go to those specific sections in links from other pages as well. For instance, I have a payment button that refers people to the section of the privacy policy on financial transactions, so I have a link to that anchor right under the button.
The problem is that this doesn’t work properly in Firefox. The fragment link resolves, but immediately goes to the top of the page. Once the visitor is on the privacy policy page, the fragment link will go to the anchor, but it requires clicking return or reload on the address bar, which is very inconvenient.
The anchors are identified with both id= and name= (I understand the latter is deprecated in HTML 5), using identical identifiers. I checked to make sure all the anchors are closed immediately rather than wrapped around other elements. I also tried completely removing the name= attribute (just using id=) and just using name=. As an experiment, I also tried applying the id attribute for one anchor directly to the applicable heading tag, removing the separate anchor tag. All these variations behave the same way: They work fine if the visitor is already on the privacy policy page, but don’t work otherwise.
This does not appear to be an issue in Chromium-based browsers, but is a problem in Firefox.
Does anyone know how to resolve this problem? Web searching suggests it’s been a Firefox issue for a long time and the only workarounds I’ve seen involve using JavaScript to force a page reload, which does not sound like a great solution on a site that’s already straining the resources of its shared server.
Thanks!
The page I need help with: [log in to see the link]
- The topic ‘Anchor links not working properly’ is closed to new replies.