Search code examples
jqueryprototypejs

Convert Prototype Ajax Responders to jQuery


I am looking for help to convert this prototype to jquery. Thank you.

Ajax.Responders.register({ 
  onCreate: function(){
    if($('ajax_busy') && Ajax.activeRequestCount > 0){ 
   Effect.Appear('ajax_busy', {duration: 0.5, queue: 'end'});
    } 
  },
  onComplete: function(){ 
 if($('ajax_busy') && Ajax.activeRequestCount == 0){
      Effect.Fade('ajax_busy', {duration: 0.5, queue: 'end'});
    } 
  }  
});

Solution

  • I think ajaxStart ajaxStop

    http://api.jquery.com/ajaxSend/

    http://api.jquery.com/ajaxStop/