<script>
function q1() {
// μ¬κΈ°μ μ½λλ₯Ό μ λ ₯νμΈμ
$('#names-q1').empty()
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/seoulbike",
data: {},
success: function (response) {
let rows = response['getStationList']['row']
for (let i = 0; i < rows.length; i++) {
let location = rows[i]['stationName']
let count = rows[i]['rackTotCnt']
let max = rows[i]['parkingBikeTotCnt']
let temp_html = ``
if (max > 5) {
temp_html = `<td class="bad">${location} : ${count} : ${max}</td>`
} else {
temp_html = `<td>${location} : ${count} : ${max}</td>`
}
$('#names-q1').append(temp_html)
}
}
})
}
</script>
λΆλͺ μ΄λ κ² λ°°μ λ€..
μ΄λ κ² λ°°μ λ¨ λ§μ΄λ€!!!!!!!
νμ΄)
<script>
function q1() {
$('#names-q1').empty()
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/seoulbike",
data: {},
success: function (response) {
let rows = response['getStationList']['row']
for (let i = 0; i < rows.length; i++) {
let name = rows[i]['stationName']
let rack = rows[i]['rackTotCnt']
let bike = rows[i]['parkingBikeTotCnt']
let temp_html = `<tr>
<td>${name}</td>
<td>${rack}</td>
<td>${bike}</td>
</tr>`
$('#names-q1').append(temp_html)
}
}
})
}
</script>