File: /var/www/test/wp-gps.html
<html>
<body>
<p id="demo"></p>
<script>
const x = document.getElementById("demo");
window.onload = function() {
getLocation();
};
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
var myresult = 'notSupported';
//FileMaker.PerformScript('saveLocation', myresult);
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
var myresult = position.coords.latitude + ',' + position.coords.longitude;
<!--FileMaker.PerformScript('saveLocation', myresult);-->
x.innerHTML = myresult;
}
</script>
</body>
</html>