JQuery를 사용하고 있습니다. when. 구문은 다음과 같습니다JQuery로 오류 처리시
$.when(
// Get the HTML
$.get("/feature/", function(html) {
globalStore.html = html;
}),
// Get the CSS
$.get("/assets/feature.css", function(css) {
globalStore.css = css;
}),
// Get the JS
$.getScript("/assets/feature.js")
).then(function() {
// Add CSS to page
$("<style />").html(globalStore.css).appendTo("head");
// Add HTML to page
$("body").append(globalStore.html);
});
내 질문
- 나는 오류 처리를 할 수있는 방법을 때 다른 시나리오에 대한 예외 처리의 서버 결과에 대한 호출 (실패 시나리오) 또는 오류 중 하나?
- 여기에서 Ajax 요청을하고 있으므로 Ajax 요청에 대한 시간 초과 기간은 어떻게 정의 할 수 있습니까?
확인하셨습니까? –