커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
3-7. Fetch 시작하기 관련 api 코드스니펫 오류?
코딩이 처음이어도 쉽게 배우는 웹개발 A to Z
챕터 3
북마크
장*홍
댓글
1
추천
0
조회수
5
조회수
5
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


3-7 강의에서

http://openapi.seoul.go.kr:8088/6d4d776b466c656533356a4b4b5872/json/RealtimeCityAir/1/99

이거를 활용해야 결과가 제대로 나오고


http://spartacodingclub.shop/sparta_api/seoulair


이거를 활용하면 안나오네요~






작성한 코드 및 에러 메세지

<!doctype html>

<html lang="ko">


<head>

<meta charset="UTF-8">

<title>Fetch 시작하기</title>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script>

function hey() {

let url = 'http://openapi.seoul.go.kr:8088/6d4d776b466c656533356a4b4b5872/json/RealtimeCityAir/1/99';

fetch(url).then(res => res.json()).then(data => {

console.log(data)

})

}

</script>

</head>


<body>

<button onclick="hey()">fetch 연습!</button>

</body>


</html>



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴