Answer the question
In order to leave comments, you need to log in
What are the ways to change the language on the site without reloading the page?
Let's say we also have ru
languages en
for the site. The default en
is , you need to change the page language to ru
. How to implement this correctly? The only thing that comes to my mind is clearing the block and then filling it with text from the array in json
. And then, I still think that this is literally an idiotic way.
Answer the question
In order to leave comments, you need to log in
well, you can store static text that will always be the same in the same element in the data attribute, and then replace it everywhere with one line through js. and the content - in any case, through ajax you will have to load
like this: https://jsfiddle.net/iBird/zLezzktL/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question