자바스크립트에서 json을 가져오는 방법
fetch('https://365ok.co.kr/dn/javascript/users.json')
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(console.error);
결과
[{
"id": 1,
"name": "이순신"
}, {
"id": 2,
"name": "사임당"
}]
등록된 댓글이 없습니다.