js XMLHttpRequest로 데이터 가져오기
2021.04.13
const content = document.getElementById("content"); let xhr = new XMLHttpRequest(); xhr.open('GET', 'https://jsonplaceholder.typicode.com/posts'); xhr.send(); xhr.onload = function () { if (xhr.status >= 200 && xhr.status < 300) { const datas = JSON.parse(xhr.response); for(let i in datas){ let data = document.createElement("h2"); let text = document.createTextNode(`ID - ${datas[i].id} & Title -..