
미세먼지를 업데이트하면 아래같이 이상하게 숫자가 변환되서 나옵니다.
용산구 같은 경우에는 -99로 나오고요.
왜 그러는걸까요 작성한 코드도 아래에 붙여놓았습니다.
<script>
function q1() {
$('#names-q1').empty()
$.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 = ``
if (gu_mise > 120) {
temp_html = `<li class="bad">${gu_name}: ${gu_mise}</li>`
} else {
temp_html = `<li>${gu_name}: ${gu_mise}</li>`
}
$('#names-q1').append(temp_html)
}
}
})
}
</script>
