Displaying a spinner

K

kevin cline

When posting an AJAX request to update multiple page elements, how do
I display a spinner in the elements until the request completes?
 
E

Evertjan.

Randy Webb wrote on 09 jan 2008 in comp.lang.javascript:
kevin cline said the following on 1/9/2008 5:24 PM:

Make the request, put a spinning gif in the container, replace the
spinning gif when the request completes.

I thought he requested Ajax to incarcerate a male spinster.
 
K

kevin cline

kevin cline said the following on 1/9/2008 5:24 PM:


Make the request, put a spinning gif in the container, replace the
spinning gif when the request completes.

Thanks, but do the browsers have standard spinners built in?
 
T

timothytoe

Thanks, but do the browsers have standard spinners built in?

That's not a bad question, but it would be the OS that has the spinner
if you're talking about what the mouse pointer does when the browser
is busy.

I just tried this in jQuery...

$(this).css("cursor","wait");

....and it shows the hourglass, spinning blue circle, or whatever your
OS has for a busy. So if it's the mouse pointer you're looking to
change to its busy state, I think that's your answer. Change the
cursor to "wait".
 
T

Thomas 'PointedEars' Lahn

timothytoe said:
That's not a bad question, but it would be the OS that has the spinner
if you're talking about what the mouse pointer does when the browser
is busy.

1. Some browsers provide their own pointing-device cursors.

2. You would be referring to Mac OS X's default behavior only:
http://en.wikipedia.org/wiki/Spinning_wait_cursor

3. Probably pointing-device cursors were not meant but instead items like
these:

http://www.yup.com/articles/2006/05/04/transparent-background-spinners-for-ajax/
I just tried this in jQuery...

Oh, please. Search the archives for jQuery and why to eschew it.


PointedEars
 
T

Thomas 'PointedEars' Lahn

kevin said:
Thanks, but do the browsers have standard spinners built in?

They have, and for example in Firefox you could use this URI:

chrome://global/skin/throbber/Throbber-small.gif

(That's easy enough to find out with the DOM Inspector.)

However, the problem is to detect Firefox (or any other browser for
that matter), provided you even can refer to the animation with an URI:

http://PointedEars.de/scripts/test/whatami

So you better refer to your own image resources.


PointedEars
 
T

timothytoe

1. Some browsers provide their own pointing-device cursors.

2. You would be referring to Mac OS X's default behavior only:
http://en.wikipedia.org/wiki/Spinning_wait_cursor

3. Probably pointing-device cursors were not meant but instead items like
these:

http://www.yup.com/articles/2006/05/04/transparent-background-spinner...


Oh, please. Search the archives for jQuery and why to eschew it.

PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann

Oh please, keep your obnoxious attitude to yourself. I just used
jQuery to take a look to see if the "wait" cursor looked like what he
wanted. I think it's more than your ears that are pointed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top