AJAX - The Complete Reference

(avery) #1

340 Part II: Developing an Ajax Library^


Ajax Application’s Activity Indicators


In the case of an Ajax application, the developer is responsible for informing the users of
network activity since, as of now, the browsers do very little to show that back channel
communication is happening. Of course the browser’s lack of involvement may change over
time, particularly if Ajax-based communication schemes are used too much for mischief.

NNOT EOTE When employing some traditional JavaScript communication techniques such as inline
frames, some browsers may indicate data transmission using some of their built-in features.

For now, Ajax developers are required to set their own indications of activity, usually by
displaying some message or animation indicating network activity is going on. The most
commonly seen network progress indicators are a type of spinning circle or arrow image, a
few of which are shown here:

Progress bars are also often used, though given their orientation they tend to be
reserved for larger page zone update indications.

Textual loading messages are used and are often in a set place such as the upper right
corner of the screen.

Occasionally, cursor changes are introduced to indicate network activity. Given the
user’s eye focus on the cursor, it seems a woefully underutilized facility by Ajax developers.

The wait and progress indicators are most often used as defined by CSS for the
cursor property, but in many browsers it is also possible to define a custom cursor by a
particular cursor URL. However, you should specify a fallback cursor in case this is not
supported as shown by the following CSS rule:

.requestInProgress {cursor: url("cursors/customwait.cur"), wait; }
Free download pdf