私は次のコードを持っています:
<script type = "text/javascript">
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(geofields);
}
}
function geofields() {
if (document.getElementById('starthere').checked == 1) {
document.getElementById('start').value = position.coords.latitude + " " + position.coords.longitude;
} else {
document.getElementById('start').value = '';
}
}
</script>
function geofields(){
'start'要素の値を(GetLocation()スクリプトから受け取った)座標に変更してGeoLocationを表示したいのですが、上記のコードでは機能しません。助言がありますか?