Anchor problem in Safari on Windows

Asked

Viewed 178 times

1

Hello, I have two pages, one of them contains an anchor for a section of the other page:

<dsp:a page="${publicUrl}${URLs.club}#ancora" class="veja-mais block">

In this other I have one , which is in the right place where it should be directed.

The problem I’m facing is that when I click on the link that contains the anchor, Safari removes the #, thus not directing.

I tried to use a Section, name, class, but it still doesn’t work.

Does anyone know what it might be? In other browsers it works correctly.

Here the codes:

Page 1: <dsp:a page="${publicUrl}${URLs.club}#ancora" class="veja-mais block">

Page 2: <div id="ancora"></div>

1 answer

1

This is a known Safari problem. The browser removes anchors in cases of redirects to different pages (more specifically, when redirect headers are present).

Removing the redirect doesn’t seem like an option in your case, so I suggest you try overwriting:

<dsp:a page="${publicUrl}${URLs.club}#ancora" class="veja-mais block">

for

<dsp:a page="${publicUrl}${URLs.club}/#ancora" class="veja-mais block">

The bar does not interfere with the operation of other browsers, and apparently solves the problem in Safari.

Source: Soen

  • I tried to put the /#, but no browser found 404 on the pages.

  • What are the values of ${publicUrl} and ${Urls.club}?

  • ${publicUrl} is the main url of the site 'www.site.com.br' and ${Urls.club} is the page '/club'.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.