当ajax请求触发并完成时,我想用jquery ui进度条显示进度.问题是我不知道如何根据ajax请求的进度设置进度条的值.这是一个开头的代码:
function ajaxnews()
{
$('.newstabs a').click(function(e){
var section = $(this).attr('id');
var url = base + 'news/section/' + section;
$.ajax({
url : url,
dataTye : 'html',
start : loadNews,
success : fillNews
});
});
}
// start callback functions
function loadNews()
{
$('#progressbar').fadeIn();
$('#progressbar').progressbar({ //how shoud I set the values here});
}
function fillNews()
{
$('#progressbar').progressbar('option', 'value', ?? /* how do I find this?*/);
$('#progressbar').fadeOut();
}
Run Code Online (Sandbox Code Playgroud)