vendredi 23 octobre 2020

Get current URL and add something in front with JavaScript

For a multi-language website, I want two buttons for the two languages that exist on the website.

The standard url would be: mydomain.com/something (this would be in german for example)
The english url for this is: mydomain.com/en/something

How can I set up the buttons to get the current url/ page (in this case /something and add /en in front of it? Everything I found was to add stuff after the full domain.

Thank you very much.




Aucun commentaire:

Enregistrer un commentaire