Activate Magento ajax loading graphic using jQuery

I extend Magento js using jQuery.
I need ajax loading mask and grahpic for jQuery ajax request.
I want to achieve consistent look and feel.
I want to activate Magento ajax loading graphic initially used in prototype using jQuery.

Although prototype register global event handlers for ajax create and complete events, the handlers will not fire by jQuery ajax request. For jQuery to activate ajax loading graphic, I manually fire the onCreate event in jQuery function.

var r = {options:{loadArea:''}};
varienLoaderHandler.handler.onCreate(r);

to deactivate

varienLoaderHandler.handler.onComplete();

Let me know if you know a better way to tie jQuery and prototype together.

One thought on “Activate Magento ajax loading graphic using jQuery”

Leave a Reply

Your email address will not be published. Required fields are marked *