
$.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라고 단어를 정해서 코드를 짜는 이유가 있는 것인가요?
