0

My site is pretty slow. Yep, moving will solve the problem. But in the meanwhile I want to display a loading gif in the top right corner if any content is loading. My site is running Magento. So I was thinking to get it global, I have to customize the prototype.js for Ajax calls. Further I have to put a small JavaScript on every page (for the normal page load). Any ideas how I can get this working? I already looked into the prototype, but I couldn't find the specific function.

Every help is much appreciated.

Thank you!

Hannes

Hannes P
  • 21
  • 1
  • 6

1 Answers1

0

You can check Ajax.Responders http://prototypejs.org/doc/latest/ajax/Ajax/Responders/

Ajax.Responders.register({
  onCreate: function() {
    $('loading').show();
  },
  onComplete: function() {
    $('loading').hide();
  }
});

Also in jquery you can use: http://api.jquery.com/category/ajax/global-ajax-event-handlers/

hknkrt
  • 96
  • 4