View Full Version : AJAX Loading Message
phpnut
10-10-2006, 03:51 PM
How would I go about telling the user their request was loading? For example, if a form was submitted using AJAX, how could I say it was loading, then have it say it was finished when it was finished. With the XMLHttpRequestObject status codes?
Usually, you'd use a "spinner".
Basically, it's like the throbber design seen in Firefox, so it's a ring of dots that spins (one dot is lit up while the others are grey).
You show this so that the user knows there's some activity and doesn't freak out (you could also use a loading message with this).
With Prototype, something like:
<a href="#" onclick="new Ajax.Updater('updater_div', 'returnthis.php', {asynchronous:true, evalScripts:true, onComplete:function(request){Element.hide('message ');}, onLoading:function(request){Element.show('message' )}}); return false;">LINK</a>
I haven't toyed with these two as they were ripped from some Rails generated AJAX, but they seem to work for me.
lionsgate
11-29-2006, 01:03 PM
Does that script work? I think there is a error. I'll try myself then i'll let you know.
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.