navigator.geolocation.getCurrentPosition terkadang berfungsi terkadang tidak
Jadi saya memiliki JS yang cukup sederhana menggunakan jammy navigator.geolocation.getCurrentPosition. $(document).ready(function(){ $("#business-locate, #people-locate").click(function() { navigator.geolocation.getCurrentPosition(foundLocation, noLocation); }); navigator.geolocation.getCurrentPosition(foundLocation, noLocation); function foundLocation(position) { var lat = position.coords.latitude; var lon = position.coords.longitude; var userLocation = lat + ', ' + lon; $("#business-current-location, #people-current-location").remove(); $("#Near-Me") .watermark("Current Location") .after("<input type='hidden' name='business-current-location' id='business-current-location' value='"+userLocation+"' />"); …