kack kack - 4 months ago 7x
jQuery Question

geolocation API is always track my location or not?

Now I am using

geolocation API
for get current location of user, but once I am allowed share my location then it will not asked again. But if my location will change then
geolocation API
give me old location or new location?


Finally, Got it my answer, if you want to track location then need to use watchPosition

Please find below code for track your location

var x = document.getElementById("demo");
function getLocation() {
    if (navigator.geolocation) {
    } else {
        x.innerHTML = "Geolocation is not supported by this browser.";
function showPosition(position) {
    x.innerHTML = "Latitude: " + position.coords.latitude +
    "<br>Longitude: " + position.coords.longitude;