🔖현재 날씨 서버에서 받아와서 표시해주기
🔎 날씨 OpenAPI
http://spartacodingclub.shop/sparta_api/weather/seoul
🔎 로딩 후 호출하기
$(document).ready(function(){
alert('다 로딩됐다!')
});
🔎 Head
<script>
$(document).ready(function () {
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/weather/seoul",
data: {},
success: function (response) {
let temp = response['temp']
$('#temp').text(temp)
}
})
});
</script>
🔎 Body
<p>현재 기온 : <span id="temp">00.0</span>도</p>
특정 값만 변경하고 싶으면 span태그를 쓴다.
☀️ 느낀점
숙제가 엄청 쉽게 풀렸다. 앞으로의 숙제도 이렇게 쉬웠으면 좋겠지만, 난 어렵다는 걸 알아서...ㅎㅎㅎ
주말에 알고리즘공부를 하기 위해선 오늘 최대한 달려야 겠다. 3주차까지 마루리해야한다. 오후에도 최대한 수강해야겠다.
'풀스택 개발일지' 카테고리의 다른 글
[웹개발 종합반 3주차] 웹스크래핑(크롤링) (0) | 2022.10.21 |
---|---|
[웹개발 종합반 3주차] Python, 크롤링, mongoDB (2) | 2022.10.21 |
[웹개발 종합반 2주차] Ajax 연습하기 (0) | 2022.10.21 |
[웹개발 종합반 2주차] JQuery 연습하기 (0) | 2022.10.21 |
[웹개발 종합반 2주차] jQuery (0) | 2022.10.21 |
댓글