Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

Clicking Anchor link, it gets appended in URL. How to stop it?

Avatar

Level 4

Hi,
I'm using anchor links in page for some purpose within it. But when anchor link is clicked, it gets appended to URL in browser.

Suppose anchor link is #tab1, when it is clicked #tab1 gets added to URL (?wcmmode=disabled#tab1) which I don't want.

Is there any way I can stop this from happening?

1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Employee Advisor

Hi @sesmic,

 

As it is a browser feature you need to override the default behavior through the script. You might check this as well.

https://stackoverflow.com/questions/17012592/keep-url-unaffected-when-anchor-link-is-clicked 

 

Hope this helps.

 

Regards,

Nitesh

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten

Avatar

Korrekte Antwort von
Employee Advisor

Hi @sesmic,

 

As it is a browser feature you need to override the default behavior through the script. You might check this as well.

https://stackoverflow.com/questions/17012592/keep-url-unaffected-when-anchor-link-is-clicked 

 

Hope this helps.

 

Regards,

Nitesh

Avatar

Level 5

Hi@sesmic 

anchor tag ids from the url can be hidden/removed by multiple ways as follows.

 

1. javascript - capture anchor tag click event and replace the unwanted tags

Check this video#16 - Remove anchor link id tag and # on urls when loading a page - YouTube

(Reference How to hide anchor tag from URL using jQuery (deanha.com)

2. Using CSS - (Reference - html - How to hide an anchor tag by href #id using css - Stack Overflow)

 

 

 

Hope this helps

 

Thanks,

Chandra