2010-10-21 45 views

回答

2

對於全球做這個:

$("#loading").bind("ajaxSend", function(){ 
    $(this).show(); 
}).bind("ajaxComplete", function(){ 
    $(this).hide(); 
}); 

對於個人做這樣的:

$.ajax({type: "GET", 
     beforeSend: function() { $.globalThrobberStart }, 
     complete: function() { $.globalThrobberStop  } 
     ... 

查看更多在這裏:http://docs.jquery.com/Ajax_Events