커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
2-10강 그대로 따라해도 안됩니다...
undefined주차
북마크
김*혁
댓글
3
추천
0
조회수
8
조회수
8
답변 완료
스파르타 즉문즉답

콘솔로그에서 rows에 있는 이름 그대로 따오려해도 오류가 뜨면서 리스트가 사라지구요

그대로 무시하고 해봤지만 홈페이지 업데이트를 해도 안됩니다...

코드도 첨부합니다.

<script>
    function q1() {
        $.ajax({
          type: "GET",
          url: "http://spartacodingclub.shop/sparta_api/seoulair",
          data: {},
          success: function(response){
              let rows = response['RealtimeCityAir']['row']
              for (let i = 0; i < rows.length; i++) {
                  let gu_name = rows[i]['MSRSTE_NM']
                  let gu_mise = rows[i]['IDEX_MVL']
              }
                  let temp_html = `<li>${gu_name} : ${gu_mise}</li>`
                  $('#names-q1').append(temp_html)
          }
        })
    }
</script>
취소
 공유
취소
댓글 0
댓글 알림
나의얼굴