<div style="margin:100px 0;"></div>
<div id="p" class="easyui-progressbar" style="width: 400px;"></div>
var timerId;
$(function() {
timerId = setInterval(getForm, 500);
});
function getForm() {
$.ajax({
type: "post",
url: "getProgressValueByJson",
timeout: 30000,
dataType: "json",
success: function(data) {
if (data.progressValue >= 100) {
clearInterval(timerId);
}
$('#p').progressbar('setValue', data.progressValue);
},
error: function() {
window.clearInterval(timerId);
alert("请求出错");
}
});
}