16.3. The User Interface

The key to any successful (and useful) web application is the design of the user interface. Because AjaxMail is meant to demonstrate the use of Ajax techniques, the user interface is quite simple and barebones. There are three different views of the user interface:

  • Folder view: Displays a folder of messages (either Inbox or Trash)

  • Read view: Displays a received message

  • Compose view: Displays a form so that you can send e-mails

All the views are designed to be very simple, and all are loaded when the main page, index.php, is initially loaded.

The basic layout of index.php is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Ajax Mail</title> <link rel="stylesheet" type="text/css" href="styles/AjaxMail.css" /> <script type="text/javascript" src="scripts/zxml.js"></script> <script type="text/javascript" src="scripts/json.js"></script> <script type="text/javascript" src="scripts/AjaxMail.js"></script> </head> <body> <ul id="ulMainMenu"> <li id="liCompose"> <span class="link" id="spnCompose">Compose Mail</span></li> <li><span class="link" id="spnInbox">Inbox <span id="spnUnreadMail"></span></span></li> <li><span class="link" id="spnTrash">Trash</span> (<span class="link" id="spnEmpty">Empty</span>)</li> </ul> <div id="divNotice"></div> <div id="divFolder"> <!-- folder view --> </div> <div id="divReadMail" ...

Get Professional Ajax, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.