我在页面中有3个$ .ajax请求,从服务器获取JSON内容并填充三个单独的div.这三个div中的内容非常大,因此加载所有内容需要一段时间.这些ajax调用也会在页面加载时调用,所以类似于:
$(document).ready(function () {
$.ajax({
type: 'POST',
url: "/controller/action",
dataType: 'json',
traditional: true,
async: false,
success: function (data) {
//fill content in div 1
}
});
$.ajax({
type: 'POST',
url: "/controller/action2",
dataType: 'json',
traditional: true,
async: false,
success: function (data) {
//fill content in div 2
}
});
$.ajax({
type: 'POST',
url: "/controller/action3",
dataType: 'json',
traditional: true,
async: false,
success: function (data) {
//fill content in div 3
}
});
});
Run Code Online (Sandbox Code Playgroud)
我的重要问题是:
非常感谢!发条装置