은은하게 코드 뿌시기

ajax 기달리게 하기 async ajax 비동기 본문

카테고리 없음

ajax 기달리게 하기 async ajax 비동기

은은하게미친자 2024. 10. 24. 15:22
728x90
async: false, // 요청이 완료될 때까지 코드 실행이 멈춤
$.ajax({
    type: 'post',
    url: 'example.com/api',
    data: { key: 'value' },
    async: false, // 요청이 완료될 때까지 코드 실행이 멈춤
    success: function(response) {
        console.log('Response received:', response);
    },
    error: function(xhr, status, error) {
        console.error('Request failed:', error);
    }
});
728x90
Comments