728x90 반응형 Ajax2 [JS/리액트] Ajax 한 눈에 보기 ( jquery / axios 의 공통점과 차이점) AJAX요청 JS - jQuery 로 요청$.get('https://codingapple1.github.io/hello.txt').done(function(){ });리액트 - axios 로 요청 axios.get("https://codingapple1.github.io/shop/data2.json").then(function(){ });axios.get("https://codingapple1.github.io/shop/data2.json").then(() => { });jQuery의 $.get와 Axios의 axios.get의 공통점공통점 >.done 아니면 .then 뒤에 붙이고 콜백함수넣고 파라미터(data - 작명 자유롭게) 하나 만들기$.get('https://codingapple1.github.. 2024. 5. 28. [JS] Ajax 정리 (1) GET / POST 비교GET요청 - 서버에 있던 데이터를 읽고싶을 때POST요청 - 서버로 데이터를 보내고 싶을 때 GET, POST 요청을 저렇게 날리면 , 브라우저가 새로고침된다.= Ajax 사용하기 AJAX란?- 서버에 GET, POST 요청을 할 때 새로고침 없이 데이터를 주고받을 수 있게 도와주는 브라우저 jQuery로 AJAX요청하기 GET 요청$.get('https://codingapple1.github.io/hello.txt');여기 경로 데이터 갖고옴$.get('https://codingapple1.github.io/hello.txt').done(function(data){ console.log(data)});데이터 확인하기= .done 아니면 .then 뒤에 붙이고 콜백함수넣.. 2024. 4. 3. 이전 1 다음 728x90 반응형