Ajax activity indicator
Moderator: General Moderators
Ajax activity indicator
Hello
I have a page where I manage any textarea manipulation with ajax (jquery) and this can required time..
So I think to use a "progress bar" or "activity indicator" that help user to know that is running a process and denied any other "click" on page..
I have found this resource but not uderstand if/how use for create what I need
http://jquery.com/demo/thickbox/
Thanks
I have a page where I manage any textarea manipulation with ajax (jquery) and this can required time..
So I think to use a "progress bar" or "activity indicator" that help user to know that is running a process and denied any other "click" on page..
I have found this resource but not uderstand if/how use for create what I need
http://jquery.com/demo/thickbox/
Thanks
-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
Thickbox is not what you need.. you probably want to take a look at the ajax functions that jQuery provides, specifically $.ajaxStart() and $.ajaxStop().
http://docs.jquery.com/Ajax#ajaxStart.28_callback_.29
http://docs.jquery.com/Ajax#ajaxStart.28_callback_.29
Hi, thanksnickvd wrote:Thickbox is not what you need.. you probably want to take a look at the ajax functions that jQuery provides, specifically $.ajaxStart() and $.ajaxStop().
http://docs.jquery.com/Ajax#ajaxStart.28_callback_.29
I have try this
Code: Select all
$().ajaxStart($.blockUI()).ajaxStop($.unblockUI);
But I need to block ONLY when time runnig for ajax is more than X seconds.
This because also for small operation (<= 2 second) is more long with blockUI
Possible to make this ?
I need also to custom block message, I have try to put this on blockUI() but not work
Thanks
I have try this:
but not working
Code: Select all
setTimeout("ajaxStart($.blockUI).ajaxStop($.unblockUI)", 3000); // 3 seconds
opsfeyd wrote:It appears you're missing a part of the expression.
I have try first but not working, think to have make any other error before
now this is ok
Code: Select all
setTimeout("$().ajaxStart($.blockUI).ajaxStop($.unblockUI)", 6000); // 6 seconds
1. is not really 6 seconds.. after 2/3 they start
2. after first timeout ALL ajax xall blockUI
I have made other errors ?
Thanks for help
:'(
I have try this at first row of my script
But not work properly, after first timeout is always blockUI
I have also try to put into my primary function
But seems not work

I have try this at first row of my script
Code: Select all
timeId = setTimeout("$().ajaxStart($.blockUI).ajaxStop($.unblockUI)", 3000); // 3 seconds
clearTimeout(timeId);
I have also try to put into my primary function
Code: Select all
function moveOne(type) {
timeId = setTimeout("$().ajaxStart($.blockUI).ajaxStop($.unblockUI)", 3000); // 3 seconds
// other code
clearTimeout(timeId);
}
-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
It doesn't look like you're using ajaxstart/stop as they're intended to be used (as i gathered from my use of them).
You then make your ajax requests as always and jQuery will run the functions you create to handle the start/stop of the ajax request.
Code: Select all
$.ajaxStart(function(){
$.blockUI();
});
$.ajaxStop(function(){
$.unblockUI();
});- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
You're not timing things properly - you need to do things in the following order:
Code: Select all
$.ajaxStart(function(){
ajaxTimer = setTimeout("$.blockUI()",3000);
});
$.ajaxStop(function(){
clearTimeout(ajaxTimer);
$.unblockUI();
});