Hi,

I had the same issue, but fixed it as follows:

Ajax.Responders.register( {
  onCreate: function() {
    // update a span on the page displaying the number of actively
executing AJAX calls...
    $('ajaxcounter').update(Ajax.activeRequestCount);

    if (Ajax.activeRequestCount === 1) {
      // display your swirling icon ;)
      $('ajaxloadingindicator').show();
    }
  },
  onComplete: function() {
    // update a span on the page displaying the number of actively
executing AJAX calls...
    $('ajaxcounter').update(Ajax.activeRequestCount);
    if (Ajax.activeRequestCount === 0) {
      // hide your swirling icon ;)
      $('ajaxloadingindicator').hide();
    }
  }
};

The above will show your icon, and also show the number of executing
ajax calls any time, for as long as you do all your ajax calls through
prototypejs (we have some old code we still need to migrate to
prototypejs, so for some of those processes, it doesn't work for us,
but this does the trick ;) )

Cheers,
David.

On Oct 20, 1:52 am, JoJo <tokyot...@gmail.com> wrote:
>     * onUninitialized,
>     * onLoading,
>     * onLoaded,
>     * onInteractive,
>     * onComplete and
>     * onException.
>
> I'm trying to display a swirly animated GIF while my AJAX request is
> being processed.  I am currently using the onLoading callback to
> display the GIF.  In some rare cases, the onLoading callback is
> actually called after onSuccess, so the swirly erroneously swirls
> forever. I attempted to switch over the swirly handling to
> onUninitialized, but that doesn't seem to be called in an anymore
> predictable manner than onLoading.  Is there a Prototype solution to
> this or should I program my own callback engine?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to