上の入力フィールドに入力します。は、私は次のよう<code>HTML</code>フォームを持っているフォーム提出
lat
とlong
を取得するための関数は、JavaScript
です。値(js
とjQuery
はOKです)を記入して、ロジックを続行するための最もreasonalbe方法だろう何
function startStopTimerSubmit(){
navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
}
function foundLocation(position){
var lat = position.coords.latitude;
var long = position.coords.longitude;
document.getElementById('latitude').value = lat;
document.getElementById('longitude').value = long;
}
function noLocation()
{
alert('Could not find your location. Please, try again.');
}
?
ご迷惑をおかけして申し訳ございません。
は悪い習慣です...のようなのようなもののようなものをしたいと思います。 –
正直でありがとう。これは更新されました。しかし、これを解決する適切な方法は依然として問題です。 – WpDoe
@MilindAnantwar - いいえ、そうではありません。これは、スコープに使用されるJSの中心的な機能です。 – Quentin