ajax - Spinner on a window -


i have window has treeview nodes , sub-nodes. when copy subnode/node , try paste node, window tends unresponsive. , once paste completed, refreshes destination paste. functionality takes place below.

now how can show spinner between copy , paste such window treeview becomes faded , displays spinner until paste completes. appreciated.

$.ajax({     type: 'post',     url: '/test.aspx',     data: data,     success: function(result) {         refresh(id);         if (result != "success") alert("copy failed");         else {             alert("successfully copied");         }     } }); 

$("#divprogress").html("<img src='yourimg.gif' alt='loading..' />").fadein(100,function(){     $.ajax({      type: 'post',      url: '/test.aspx',      data: data,      success: function(result) {         $("#divprogress").fadeout(300,function(){               refresh(id); // not sure does!!! ...??               if (result != "success")                {                  alert("some error!");               }               else               {                  alert("successfully copied");               }         });      }   });  }); 

assuming divprogress div want show loading image , spinning image name yourimg.gif. may need change image path according scenario.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -