Z
Z
zhiga2016-10-18 13:00:43
JavaScript
zhiga, 2016-10-18 13:00:43

How to substitute title value depending on session and page via ajax?

sessions and the current language (localization) are implemented on the client using store.js

after loading all the components, I need to change the < title > value to the value from json

Now I did this:

First, the current localization in the session is checked, then the language constants of the desired language are loaded via ajax, then all span elements with the lang class are assigned their values ​​depending on the value of the data-l-id attribute, then the necessary component scripts with the required localization are added.

But what about the title of the page, which is indicated in <title>? After all, the application is one-page, but there are many pages and 4 localizations.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Korotaev, 2016-10-18
@lekzd

Is there a document.title variable, which is responsible for what is written on the tab, do you need to update it, or did you mean something else?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question