How to show loading spinner in jQuery?

Posted by Edward Tanguay on Stack Overflow See other posts from Stack Overflow or by Edward Tanguay
Published on 2008-09-16T01:18:15Z Indexed on 2012/03/19 2:03 UTC
Read the original article Hit count: 295

In Prototype I can show a "loading..." image with this code:


var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, 
onLoading: showLoad, onComplete: showResponse} );

function showLoad () {
    ...
}

In jQuery, I can load a server page into an element with this:

$('#message').load('index.php?pg=ajaxFlashcard');

but how do I attach a loading spinner to this command as I did in Prototype?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about spinner