Hi Community,
I am working on a scenario where i have to capture the location of user using javascript and i am trying to publish , it works fine but while loading survey form it will throw an error saying like failing to load data from source.
Please assist me get out of this situation.
Thank you in advance
Rakesh,
Can you please provide the JavaScript you're using to get the user's location?
-Josh
Hi GeoJosh
Actually i dont have any idea about javascript but i got this code from some post and its working for me.
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude ;
}
If you have any other javascript format to get user current location, please share with me it helps me a lot