Richard Parnaby-King

Providing user feedback on background operations

On any website that does any form of background operation that prevents the user from progressing immediately (for example an ajax operation that updates search filters based on the currently selected option) then the user needs to be informed.

The simplest method for implementing this is to change the users’ mouse cursor. This can be implemented by adding a class to the body that changes the users cursor when you start the background operation, and remove the class when the background operation completes.


In the example of an ajax operation using jQuery:
//when user changes the drop-down option…
$(‘form select’).change(function(){

//… and add the ajax class to the body …

//… do an ajax call to get the next lot of drop-down filters.
var value = $(this).parent().serialize();
type: “POST”,
url: “/ajax-search”,
data: value,

//when the ajax function returns…
success:function(data) {
//…do something with the search form

//… and remove the ajax class last.

So that adds the class to our website, this is the little bit of css you need to change the users’ cursor:
body.ajax, body.ajax * {

And that is it! See it in action


By adding a little bit of feedback to the user you reduce the frustration experienced when the website “stops” for a bit.