progress spinner
How do I show a progress spinner during an ajax call? I got the spinner gif from Link and my code to make ajax call is using Dojo开发者_运维百科:
dojo.xhrPost( {
form: formName,
sync: true,
handleAs: "text",
load: function(response) {
//Spinner should be called here.. How?
//populate content here
successMessage();
} ,
error: function(error, ioargs){
//do something with errors
Have global javascript functions (eg showAjaxWorking()
, hideAjaxWorking()
to show/hide a div containing a spinner image, positioned in a standard place, or somehwere specific if that suits..
showAjaxWorking();
dojo.xhrPost( {
form: formName,
sync: true,
handleAs: "text",
load: function(response) {
hideAjaxWorking();
successMessage();
} ,
error: function(error, ioargs){
//do something with errors
hideAjaxWorking();
精彩评论