开发者

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜