function onGeoOk(position){
const lat = position.coords.latitude;
const lng = position.coords.longitude;
console.log("너는 여기있다", lat, lng);
}
function onGeoError(){
alert("널 못찾았다..날씨 못줘");
}
navigator.geolocation.getCurrentPosition(onGeoOk,onGeoError);
'자바스크립트 기기기초' 카테고리의 다른 글
#8.1 Weather API (0) | 2023.02.16 |
---|---|
#7.8 Deleting To Dos part Three (0) | 2023.02.15 |
#7.7 Deleting To Dos part Two (0) | 2023.02.15 |
#7.6 Deleting To Dos part One (0) | 2023.02.15 |
#7.5 Loading To Dos part Two (0) | 2023.02.15 |