Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

29 August 2008

Waiting cursor during Prototype’s Ajax.Request

In your stylesheet:

body.waiting {
  cursor: wait;
}

In your script:

document.body.addClassName('waiting');
new Ajax.Request(uri, {
  onComplete: function() {
    document.body.removeClassName('waiting');
  }
});

You probably want to be careful to make sure it's in the onComplete method and not the onSuccess method. Even better might be to create a setTimeout("document.body.removeClassName('waiting')", 3000), so you don't break the cursor for the rest of the page visit.

You also might prefer the "progress" instead of the "waiting" cursor. For other cursors and their compatibility check out QuirksMode.

Comments

  1. […] public links >> prototypes Waiting cursor during Prototype’s Ajax.Request Saved by independentshopper on Wed 05-11-2008 Design Thinking for Innovation Lecture Saved by […]

    Recent Links Tagged With "prototypes" - JabberTags / 9:19pm / 6 November 2008

  2. does not work in ie

    Anonymous / 5:15pm / 7 August 2009

  3. Hmmmm. Pity.

    Ryan / 10:04pm / 7 August 2009

  4. great, mate!
    thanks a lot

    Arbyter / 3:40pm / 14 December 2012

Leave a comment

Markdown

0.095 seconds