Search

Chaps

Sweet sweet memories

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

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`

0.767 seconds