【发布时间】:2014-04-11 10:20:51
【问题描述】:
根据用户操作,我需要进行从一次调用到三个并行调用的 ajax 调用。我也想为此显示进度条。任意数量的 Ajax 请求的一个进度条。以下是我要调整的示例代码。谁能建议我如何限制通话次数以及如何使用一个进度条。
$.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() {
// All is ready now, so...
// Add CSS to page
$("<style />").html(globalStore.css).appendTo("head");
// Add HTML to page
$("body").append(globalStore.html);
});
【问题讨论】:
标签: jquery progress-bar