Answer the question
In order to leave comments, you need to log in
Dynamic titles. Bad or Good?
Tell me, has anyone used dynamic titles that change depending on the region, with the connection of the Yandex map api. For example:<title>Торты</title>
if (YMaps.location.city != '') {
var youRegion = (YMaps.location.city);
if (youRegion === "Новосибирск"){
$("#title").html("ТОРТЫ НА ЗАКАЗ В НОВОСИБИРСКЕ");
} else if (youRegion === "Санкт-Петербург"){
$("#title").html("ТОРТЫ НА ЗАКАЗ В САНКТ-ПЕТЕРБУРГЕ");
} else if (youRegion === "Екатеринбург"){
$("#title").html("ТОРТЫ НА ЗАКАЗ В ЕКАТЕРИНБУРГЕ");
} else if (youRegion === "Нижний Новгород"){
$("#title").html("ТОРТЫ НА ЗАКАЗ В НИЖНИЙ НОВГОРОДЕ");
} else if (youRegion === "Казань"){
$("#title").html("ТОРТЫ НА ЗАКАЗ В КАЗАНИ");
} else {
$("#title").html("ПРОИЗВОДСТВО ТОРТОВ НА ЗАКАЗ");
}
}
Answer the question
In order to leave comments, you need to log in
TO NIZHNY NOVGORODI have to speak Russian!)))
The next question, which boils down to "do search engines execute JavaScript", yes, Google and Yandex do, since they are developed by the same people as browsers, you can double-check with Webmaster, but ideally, of course, the region should be determined on the server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question