开发者

progress spinner

开发者 https://www.devze.com 2023-03-13 17:07 出处:网络
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开发者_运维百科:

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

精彩评论

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