How to make the latitude variable work? I have tried this and nothing is appearing! In succession la within a variable latitude works, but outside does not want to function, it is empty. How to pass the variable latitude pro php? I have this code below:
$.ajax({
url:'sigilo.com.br/$ip',
type:'get',
dataType:'json',
success:function(res) {
latitude = res.lat;
longitude = res.long;
cidade = res.city;
Pais = res.country
}
});
</script>
<?php
$variavelphp = "<script>document.write(latitude)</script>";
echo $variavelphp;
?>