jQuery를 대체하는 모던 Vanilla JavaScript 구현 가이드
네트워크 요청 (AJAX)
JSON 데이터 가져오기
jQuery의 $.getJSON 기능을 순수 자바스크립트로 구현하는 방법입니다.
// jQuery
$.getJSON('/api/data', function(response) {
console.log(response);
});
// Vanilla JS (IE10+)
const xhr = new XMLHttpRequest();
xhr.open('GET', '/api/data', true);
xhr.onreadystatechange = function() {
if (this.readyState ...
6월 16일 17:40에 게시됨