navigator.geolocation.getCurrentPosition이 때때로 작동하지 않는 경우가 있습니다
그래서 navigator.geolocation.getCurrentPosition jammy를 사용하는 아주 간단한 JS가 있습니다. $(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+"' />"); $("#people-Near-Me") .watermark("Current …