How to show loading spinner in jQuery?

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 … Read more

Creating a new DOM element from an HTML string using built-in DOM methods or Prototype

I have an HTML string representing an element: ‘<li>text</li>’. I’d like to append it to an element in the DOM (a ul in my case). How can I do this with Prototype or with DOM methods? (I know i could do this easily in jQuery, but unfortunately we’re not using jQuery.) 30 s 30 HTML … Read more