Envoi de donnée en post fonctionne pas
Bonjour a tous
Je ne parviens pas a envoyer mes donnée avec se script et je ne comprend pas pourquoi
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| !DOCTYPE html>
<html>
<body>
<p id="demo" onLoad="">Your coordinates:</p>
<script>
var x=document.getElementById("demo");
function getLocation()
{
if (navigator.geolocation)
{
navigator.geolocation.watchPosition(showPosition);
}
else{x.innerHTML="Geolocation is not supported by this browser.";}
}
function showPosition(position)
{
x.innerHTML="Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
$.post('saver.php',{'lat':position.coords.latitude,'lng':position.coords.longitude});
}
getLocation()
</script>
</body>
</html> |
Quelqu'un peut m'aider ?