Section 1.5. Gmail Brings XMLHttpRequest into the Mainstream

1.5. Gmail Brings XMLHttpRequest into the Mainstream

In March 2004, the use of XMLHttpRequest to create highly interactive Web applications came to the forefront of the public's attention. Google released a beta form of Gmail, a highly interactive, JavaScript-based Web mail application. Gmail (see Figure 1-4) made waves not only for its user interface, but also for its large storage capacity. It also had an innovative invitation-based method of joining the preview, which made it even more exciting because Gmail was not open to all. Gmail was one of the first mainstream applications to make widespread use of AJAX, although the term hadn't yet been invented in 2004.

Figure 1-4. Gmail Web mail interface

Google applications spend a lot of time in beta before their final release, and Gmail is no exception. While I was writing this book (in May 2006), Gmail was still in beta. This extended beta period is useful for a large-scale application like this because it allows time for polishing the user interface and to work out any scalability issues. When you look at Gmail, this polish shows in a number of ways. AJAX and other JavaScript techniques are used throughout, minimizing full-page reloads and providing all the features you would expect in a high-quality mail reader. Gmail features available through the use of AJAX include the ability to do the following:

  • Read messages without a page reload

  • Tag messages (labels) without a page reload

  • Change folders

  • Check the spelling of messages

  • Compose messages

  • Check for new mail on a regular basis

  • View news headlines without a page reload

  • Search messages without a page reload

  • Add messages to a quick group and view just that group without a page reload

  • Save drafts automatically

The features in the preceding list provide the bulk of the rich experience, but it's the extras that complete it. For instance, users can receive feedback while they are waiting on data. This feedback comes in the form of an icon (see Figure 1-5) in the upper-right corner. Dynamic HTML (DHTML) features, such as a JavaScript rich text editor, are also available. With its large resources, Google has also made a non-JavaScript version of Gmail. It looks the same but has none of the advanced features and the continuous reloads that you see in most Web applications. This two-application approach might be difficult to replicate for some, simply due to the large amount of work involved, but it's a great way to make sure your application is accessible to everyone.

Figure 1-5. Gmail's loading indicator

There are still some minor issues with the Gmail application, and many AJAX applications will run into these issues. For instance, the browser's bookmark feature becomes useless because the URL doesn't change when content is updated, and the URL is the only identifier that the browser stores. In addition, the user interface looks similar to a native application, but it behaves differently, which can be a problem for some users because the application will fail to meet their expectations. Still, the application does attempt to alleviate this problem by giving feedback messages that tell users that an action is complete. The messages include notices that labels have been added to emails (see Figure 1-6).

Figure 1-6. Gmail provides feedback for completed actions

Because Gmail was one of the first mainstream AJAX-powered applications, it set a baseline for what users could expect. For instance, its replacement of standard browser functions, such as refresh, with links inside the application is a technique that has been copied by many other applications. This has helped increase the quality of many AJAX applications because Gmail does a good job of providing a consistent and highly usable experience.

Understanding AJAX(c) Using JavaScript to Create Rich Internet Applications
Understanding AJAX: Using JavaScript to Create Rich Internet Applications
ISBN: 0132216353
EAN: 2147483647
Year: N/A
Pages: 154

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: