Yes, I know there are a lot of Ajaxchatapplications out there, some moreadvanced than others. Which is precisely why I'm writing my own. It's a well defined application which should let me worry about learning the techniques and not about developing ground breaking new features. Chat is not quite the Hello World of Ajax, but it's one of the simplest yet useful things I could do. I didn't learn very much by writing an Ajax Hello World example and it's completely pointless :-)

Being a good software engineer, before I make a start on this Chat App here are some requirements to get me started and keep me focused. Maybe this will distract you from the fact that there's no code here - apart from that wonderful Hello World:

  1. All messages sent by other users while a user is in the chat room should be displayed to the user.
  2. Notification of new users entering the chat should be shown to all users.
  3. Notification of users leaving the chat should be shown to all users.
  4. A chat message consists of the actual text of the message, the name of the person who sent it and the time it was sent.
  5. KISS!

A mini functional spec

  1. All text is UTF-8
  2. Max length of user name is 20 characters
  3. Max length of message text is 256 characters.
  4. The user should not have to use the mouse to work the app - make good use of access keys and auto-focus.
  5. Focus should start in the message entry box once the app has loaded.
  6. Pressing ENTER should send the text in the message entry box
  7. Once a message has been sent, the message entry box should be cleared and given focus, ready for the user to type a new message.
  8. User is given a default name on first joining the chat.
  9. The default name should be unique, but simple to read.
  10. User can change their name by editing a form field
  11. Display of messages should not cause the page to become too big. Do not show more than 50 messages to the user. New messages that cause this limit to be exceeded should cause the oldest message to be removed so that the new message can be displayed.
  12. Display of messages should not cause the page to become too "physically big". Scroll the message history neatly.
  13. User should always be able to see the last message received, unless they are deliberately reviewing older messages. (i.e. Auto-scroll to make new messages visible)
  14. Only the main page should be explicitly loaded by the user - all servers communication is done in Ajax!
  15. All server communication errors should be communicated to the user in a friendly way so that any problems are obvious and diagnosable
  16. Bandwidth usage should be kept to a minimum. I don't want to have to upgrade my hosting account to run this.

Wow this post seems to have gone on a bit. Sorry. Here's a fun Ajax enabled post-it note board to wake you up.