1
see the code below wanted to catch the 2 infomations in passing to a variable or to an input.
<p id="demo">Clique no botão para receber sua localização em Latitude e Longitude:</p>
<button onchange="getLocation()" onclick="getLocation()">Clique Aqui</button>
<script>
var x=document.getElementById("demo");
function getLocation()
{
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(showPosition);
}
else{x.innerHTML="O seu navegador não suporta Geolocalização.";}
}
function showPosition(position)
{
x.innerHTML="Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
}
</script>
plus the 2 inputs are without value returns nothing.
– Roo Oliveira
@Romariooliveira even after going through the function in javascript your inputs have empty value??? Are you sure the script is coming inside the
showPosition
?– David Alves
yes I’m passing on Metho POST
– Roo Oliveira
solved worked thanks this ja
– Roo Oliveira
Tranquil @Roooliveira happy to have helped, if you can mark the answer as correct answer :)
– David Alves