。语法如下:使用JQuery处理错误当我使用JQuery <a href="http://api.jquery.com/jquery.when/" rel="nofollow">when</a>时
$.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请求的超时时间?
你检查过吗? – 2014-09-02 08:03:16