Answer the question
In order to leave comments, you need to log in
YandexMaps Api location detection, how to solve the problem in FF?
The problem with the Cyrillic domain, in FF it gives undefined:
https://yadi.sk/i/XjX-jFwJ3CcuVs
I suspect a problem in the Cyrillic domain, how to solve it? Works in all other browsers.
Connected API 2.0
ymaps.ready(init);
function init() {
var currentCity = ymaps.geolocation.city;
$('#city').html(currentCity);
console.log(currentCity);
}
Answer the question
In order to leave comments, you need to log in
<script src="//api-maps.yandex.ru/2.0/?load=package.standard&lang=ru-RU" type="text/javascript"></script>
$(document).ready(function($) {
ymaps.ready(init);
function init() {
var geolocation = ymaps.geolocation;
if (geolocation) {
$text_city = geolocation.country + ', ' + geolocation.region + ', ' + geolocation.city;
//console.log($text_city);
$("#city0").val($text_city);
$("#city1").val($text_city);
$("#city2").val($text_city);
$("#city3").val($text_city);
$("#city4").val($text_city);
$("#city_call").val($text_city);
$("#city_modreserve").val($text_city);
$("#city_reserve").val($text_city);
} else {
console.log('Не удалось установить местоположение');
}
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question