DEV/javascript
jQuery ajax 사용 예시 (jQuery를 이용한...)
석봉
2022. 11. 23. 15:02
jQuery를 이용한 ajax를 사용해 보았다.
$.ajax({
headers: {
"Content-Type": "application/json;charset=UTF-8",
"Authorization": 토큰값 등...
},
url: 사용할 URL...,
type: 'GET', // 'GET', 'POST' 등...
async: true, // 동기 - 비동기 여부. false : 다음 코드로 안넘어감, true : 다음으로 넘김
success: function (data) {
// 성공 후 동작
console.log("DATA : ", data);
}
});
jQuery 사용법
https://seokbong.tistory.com/9
jQuery 다운로드 및 사용 방법
성격 급한 사람들을 위한 CDN ( Contents Delivary Network ) 방식 사용 방법. 헤더에 하단 스크립트를 추가하면 사용 가능하다. 연습용으로 코드를 작성하다 보니 Jquery가 필요하였다. 항상 패키지 매니저
seokbong.tistory.com
https://api.jquery.com/jquery.ajax/
jQuery.ajax() | jQuery API Documentation
Description: Perform an asynchronous HTTP (Ajax) request. The $.ajax() function underlies all Ajax requests sent by jQuery. It is often unnecessary to directly call this function, as several higher-level alternatives like $.get() and .load() are available
api.jquery.com