커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
2-13강에서 코드에 무슨 오류가 있는지 모르겠어요 ㅠ
undefined주차
북마크
이*은
댓글
3
추천
0
조회수
4
조회수
4
답변 완료

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

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


강의 코드랑 어디가 다른지 모르겠어요 ㅠㅠ


<script>

function q1() {

fetch("http://spartacodingclub.shop/sparta_api/seoulbike").then(res => res.json()).then(data => {

let rows = data['getStationList']['row']

$('#names-q1').empty()

rows.forEach((a) => {

let name = a['stationName']

let rack = a['rackTotCnt']

let bike = a['parkingBikeTotCnt']


let temp_html = ``


if (bike < 5) {

let temp_html = `<tr class="red">

<td>${name}</td>

<td>${rack}</td>

<td>${bike}</td>

</tr>`

} else {

let temp_html = `<tr>

<td>${name}</td>

<td>${rack}</td>

<td>${bike}</td>

</tr>`

}


$('#names-q1').append(temp_html)

})

})

}

</script>





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