<script type='text/javascript'> var x = document.getElementById('add'); var c = function (pos) { var latitude = pos.coords.latitude; var longitude = pos.coords.longitude; coords = latitude + ',' + longitude; document.getElementById('google_map').setAttribute('src', 'https://maps.google.com.np/?q=' + coords + '&z=20&output=embed'); x.innerHTML = "lat:" + latitude + "<br /> long: " + longitude; } <pre lang="cs">document.getElementById('get_location').onclick = function () { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(c); return false; } else { alert("Geo Location is not supported on your current browser!"); } } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)