showing progressbar progress with ajax request
Posted
by Ygam
on Stack Overflow
See other posts from Stack Overflow
or by Ygam
Published on 2010-03-19T01:52:53Z
Indexed on
2010/03/19
2:21 UTC
Read the original article
Hit count: 467
Hi guys!
I want to show progress with jquery ui progress bar when an ajax request fires and when it finishes. The problem is I don't know how to set values for the progress bar depending on the progress of the ajax request. Please hlep. Here's a code to start with:
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();
}
© Stack Overflow or respective owner