Login Register

Example 3: Chatting With Tech Support

Laura Allen has been an AIM user for years, and has been reading about the business uses of chat software. One use that intrigues her is "Live Support". Her company sells very sophisticated equipment which generates many sales questions. It be very nice to have a support person on the opposite end of a chat client. Maybe if they would all just use AIM ... but this is unrealistic.

She considers writing it in PHP. The trouble is the stateless nature of the web. It's easy to send a message to the server. But that generates a page refresh that loses most of the state. Plus the refresh makes it look primitive and ugly compared to AIM.

Enter Dojo. With it, she can write a mini chat client that polls the server via XHR and no page refreshes. The ASP server portion is easy - just a simple storage mechanism and a way to transmit the data via JSON. The event model of dojo is familiar like Visual Basic or Java Swing, and passes the chat messages easily. Not to mention (and this is wickedly cool), the rich text editor of dojo makes it easy to do italics, bold, sizes, etc. Finally, wrapping this all up in a collapsible title pane tucks it out of the way so a customer can pull it in when needed.

On the operator end, dojo helps as well. Operators can have several conversations at once, with each conversation in a separate tab. The tab will light up when there's activity, so the operator can keep chats on hold without losing them.



* The source code for this demo, written by Peter Higgins, is included in the dijit/demos folder of the Dojo distribution. For now, to make this demo work you will need your own Cometd server. We hope to have a public sandbox server available shortly for your demoing pleasure.