https://openweathermap.org/api
날씨 API
뉴쓰 API
A=alert로 선언하면
a()로 할때 실행
B=alert()로 할시
ALERT의 결과값이 출력
https://jh-7.tistory.com/25 ://논블로킹?
Blocking, Non-blocking, Sync, Async 의 차이
들어가며 전 회사에서 한 선배님이 질문을 했다. Blocking 과 Non-blocking, Sync 와 Async 의 차이를 설명할 수 있냐고. 어 음... 하는 사이 선배님이 다시 말을 했다. 그 둘을 설마 같은거라고 이해하고 계
jh-7.tistory.com
위도/경도 확인 후 날씨 정보 출력하기 ( 전체 선택 Ctrl + A → 코드 복사 )
<body>
<script>
navigator.geolocation.getCurrentPosition(run);
function run(position) {
console.log(position);
const coords = position.coords;
const lat = coords.latitude;
const lng = coords.longitude;
console.log(lat, lng);
const data = fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lng}&units=metric&appid=6edee3c2aa182bc44d18ccb204c98a31`);
data.then(callback1).then(callback2);
function callback1(a) {
console.dir(a);
return a.json();
}
function callback2(response) {
const weather = response.weather;
const main = weather[0].main;
const temp = response.main.temp;
const name = response.name; // 지역명
let code = `<h1>${main}</h1><h1>${temp}</h1><h1>${name}</h1>`;
document.querySelector('body').innerHTML = code;
}
}
</script>
</body>
위도/경도 확인 후 날씨 정보 출력하기 ( 전체 선택 Ctrl + A → 코드 복사 )
무료 파이썬 호스팅 => 파이썬 애니웨어제이쿼리(이제 안씀) 유용한 스크립트 모 https://jqueryui.com/
jQuery UI
jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQue
jqueryui.com
import / export
export 시 default 를 사용하면 import에 중괄호{}를 사용할 수 없음
export시 default를 사용하지 않으면 import에 중괄호 {}를 사용해야만 됨
'자바스크립트' 카테고리의 다른 글
자바스크립트 5일차 (0) | 2023.09.04 |
---|---|
0831 자바스크립트 3일차 (2) | 2023.08.31 |
0830 자바스크립트2일차 (0) | 2023.08.30 |