in Hacking

Prototype automatic Spinner

I found the following code on the internet. By using this code, a spinner is showed automaticly if an Ajax request is running. Very nice!

// registreer een algemene spinner
  onCreate: function() {
  if (Ajax.activeRequestCount > 0)'spinner');
  onComplete: function() {
  if (Ajax.activeRequestCount == 0)

Didn't know prototype had this global register method. I should take a better look at the API!