JSON 처리 기본
데이터를 요청하는 상황 : GET요청 후 파싱
- 파싱
JSON.parse() : JSON -> 객체
- 직렬화
JSON.stringify() : 객체 -> JSON
HTML 요소 동적 세팅
const addElem = () => {
const target = document.getElementById("target");
target.innerHTML += '<추가된 리스트>';
}
방법 2
const addElem = () => {
const target = document.getElementById("target");
const liElem = document.createElement('li')
liElem.textContent = "추가된 리스트";
target.appendChild(liElem)
}
단일 데이터 처리(테이블 세팅)
n개의 데이터 처리(테이블 세팅)