Say I have something like this:
$('button').live({
click: function() {
$('body').css('cursor', 'wait');
var value = 1;
$.ajax({
type: 'GET',
url: 'http://www.domain.com/site/index.php/controller/function',
dataType: 'json',
cache: false,
async: false,
data: { variable: value },
success: function(data, textStatus, jqXHR) { // },
error: function(jqXHR, textStatus, errorThrown) { // }
});
$('body').css('cursor', 'default');
}
});
I'm trying to change the cursor because the AJAX request takes a few minutes to return a response, and I need the user not to think his browser crashed or something like that. The thing is that the line in this code supposed to do that does not work.
Any ideas?
Side note: There are no problems with the AJAX request, everything works fine