1
임 여러 요청과 함께 $ .when 사용 중. 아래 코드를 고려하십시오.
$.when(
$.ajax({url: '/show/' + showId + '/details.json', type: 'GET', dataType: 'json', async: false}),
$.ajax({url: '/show/' + showId + '/graphicAssets.json', type: 'GET', dataType: 'json', async: false}),
$.ajax({url: '/graphicAssets/show/' + showId + '/files.json', type: 'GET', dataType: 'json', async: false}),
$.ajax({url: '/graphicAssets/show/types.json', type: 'GET', dataType: 'json', async: false}),
$.ajax({url: '/season/'+ showId +'/seasons.json', type: 'GET', dataType: 'json', async: false}),
$.ajax({url: '/freebie/' + showId + '/freebies.json', type: 'GET', dataType: 'json', async: false})
)
.then(function(showDetailsData, showGraphicAssetsData, showFilesData, showTypesData, showSeasonsData, showFreebieData, status, xhr) {
if (xhr.status == '302') location.reload();
// Rest of the code goes here
}
이제 xhr 개체의 응답 상태를 확인하고 싶습니다. 결과는 정의되지 않습니다. 이 문제를 어떻게 해결할 수 있습니까? 많은 감사합니다!
대 : 귀하의 경우에 따라서
, 올바른 사용법은 다음과 같을 것입니다! 나는 내 질문에 답하려고했으나 너는 나아 갔다. 동의합니다. :) – user1966211