커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
2-8 Ajax 함께하기
undefined주차
북마크
장*윤
댓글
5
추천
0
조회수
18
조회수
18
답변 완료


$.ajax({
    type: "GET",
    url: "<http://spartacodingclub.shop/sparta_api/seoulair>;",
    data: {},
    success: function(response){
    console.log(response)
    }
    })

get 방식으로 이 url에 요청해서 response를 찍어주겠다. 이런 뜻입니다.

response를 console에다가 찍어줍니다.

$.ajax({
    type: "GET",
    url: "<http://spartacodingclub.shop/sparta_api/seoulair>;",
    data: {},
    success: function(response){
    console.log(response[ 'RealtimeCityAir']['row'])
    }
    })

이거를 돌면서 은평구 230

서대문구 175 이런식으로 찍어주고 싶은 거에요


이렇게 강의 중에 설명해주셨는데,


[ 'RealtimeCityAir']['row']

이것은 RealtimeCityAir 라는 객체 안에는 row 배열 찾는 것이라고 이해했는데,

[ 'RealtimeCityAir']['row']

앞에 response는 왜 붙이는 건가요? response라고 단어를 정해서 코드를 짜는 이유가 있는 것인가요?










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