Search

Chaps

Sweet sweet memories

Blather

Uptime verified by Wormly.com

Cairns to Alice Springs

Alice and I are riding our bikes to Alice Springs from Cairns. We have a bit of a travel blog, Flickr photos and our funny little SPOT GPS tracker page.

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

Leave a comment

Markdown
  • **bold text**
  • *italicized text*
  • > This text is blockquoted
  • * This is an unordered list item
  • 1. This is an ordered list item
  • [Link Text](http://www.example.com/)
  • `code item`

Cairns to Alice Springs

0.060 seconds