Ajax Request Progress Indicator

12 / Oct / 2009 by Bhagwat Kumar 6 comments

In my current project, I used ajax to fetch data from the server to provide experience like Desktop Application. I wanted to automatically show an indicator when an AJAX request is ongoing, and hide it when there is no such request. So I found the following solution for both the Prototype library and the JQuery library.

Make sure the following HTML is included on every page where AJAX requests are made. (Place it in body of the main layout so that you do not have to repeat this HTML on each page.

Make sure the following javascript code has been executed before any AJAX request is made. (Move this to a js file and include it in Heading part of the main layout).

The above trick worked for me and hope it works for you guys too.

Helpful links :-

http://www.prototypejs.org/api/ajax/responders

http://docs.jquery.com/Ajax/jQuery.ajax

FOUND THIS USEFUL? SHARE IT

comments (6)

  1. airtel coupons

    This is certainly especially logical matter as greater within the web page. Enjoy discussing about all across.

    Reply
  2. birthday greetings

    My brother recommended I would possibly like this web site.
    He used to be totally right. This put up truly made my day.
    You cann’t consider just how a lot time I had spent for this info!
    Thank you!

    Reply

Leave a comment - shriekfreak.com Cancel reply