maxim1o Posted May 27, 2021 Report Share Posted May 27, 2021 Для смены языка на сайте нужно в адрес добавить например /ru/ текущий адрес узнаю так <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "http://site.ru/ru/" + window.location.pathname; </script> но оно выдает текстом Вопрос: как сделать чтобы это была ссылка? Quote Link to comment Share on other sites More sharing options...
1 Switch74 Posted May 27, 2021 Report Share Posted May 27, 2021 <a id="demo"></a> <script> document.getElementById("demo").href= "http://site.ru/ru/" + window.location.pathname; </script> 1 Quote Link to comment Share on other sites More sharing options...
Question
maxim1o
Для смены языка на сайте нужно в адрес добавить например /ru/
текущий адрес узнаю так
но оно выдает текстом
Вопрос: как сделать чтобы это была ссылка?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.