vendredi 6 février 2015

PHP / HTML5 Script

whats a good solution for this -> if location is not available or denied from the user, it should redirect to another URL, not http:// xxx. xxx. com/x.php?lat= ?


my current work so far:



<meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
<span style="font-family:'Arial'">
<script type="text/javascript">
navigator.geolocation.getCurrentPosition(function(position) {
lat = position.coords.latitude;
lang = position.coords.longitude;
window.location.href = "http://ift.tt/1Ij472W" + lat + "&long=" + lang;
});
</script>
</head>
<body onload="getCurrentPosition()"></body>

Aucun commentaire:

Enregistrer un commentaire