Answer the question
In order to leave comments, you need to log in
How can I add visitor's city to text page in html?
The visitor entered the site using:
<script src="http://yastatic.net/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
window.onload = function () {
jQuery("#user-city").text(ymaps.geolocation.city);
}
</script>
<script src="http://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU" type="text/javascript"></script>
Город <div id="user-city"></div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question