【发布时间】:2013-05-17 10:39:42
【问题描述】:
我想显示加载进度条的 ajax 响应的用户百分比。 有没有办法实现它? 现在我只显示一张图片。
这是我的代码示例:
$('#loadingDiv').show();
$.ajax({
type : 'Get',
url : myUrl,
success : function(response) {
$('#loadingDiv').hide();
populateData(response);
},
error: function(x, e) {
$('#loadingDiv').hide();
if (x.status == 500 || x.status == 404) {
alert("no data found");
}
}
});
HTML 代码:
<div id="loadingDiv">
<img src="loading-img.png"/>
</div>
【问题讨论】:
-
一点research
标签: javascript jquery ajax