【发布时间】:2013-05-15 17:18:18
【问题描述】:
我有一个获取大型 json 列表的 ajax 调用。有什么方法可以制作一个进度条来获取 json 加载的真实值(例如,状态栏显示 200 分之 1 已加载)?
现在我有一个非常基本的 Ajax 调用
function SendAjax(urlMethod, jsonData, returnFunction) {
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: urlMethod,
data: jsonData,
dataType: "json",
success: function (msg) {
if (msg != null) {
ReturnJson(msg);
}
},
error: function (xhr, status, error) {
// Boil the ASP.NET AJAX error down to JSON.
var err = eval("(" + xhr.responseText + ")");
// Display the specific error raised by the server
alert(err.Message);
}
});
}
【问题讨论】:
标签: javascript jquery ajax asp.net-mvc