XML
  Home arrow XML arrow Building an AJAX-Based Chat: The Barebones...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Download TestComplete 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Web Buyers Guide
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Building an AJAX-Based Chat: The Barebones Structure
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 30
    2005-11-08

    Table of Contents:
  • Building an AJAX-Based Chat: The Barebones Structure
  • Defining the application’s core logic: working with requester objects
  • Sending chat messages: defining the “sendMessage()” function
  • Checking for the progress of sender requests: defining the “senderStatusChecker()” function
  • Updating the display of messages: coding the “displayChatData()” function

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    Building an AJAX-Based Chat: The Barebones Structure
    (Page 1 of 5 )

    Chat programs are common on the web these days. HTTP-based versions were often built as Java applets, but today, developers have a wider range of options when building chat programs. This article gets you started with building one that uses AJAX as the workhorse for sending out http requests without the need for page reloading.

    You’ve been seen it hundreds, if not thousands of times before. You’ve surfing the Web, looking for a website that offers the possibility of meeting people and talking in real time, and certainly many times during your exhaustive search, you’ve been confronted with the user interface of an IRC (Internet Relay Chat) application, most of the time developed in Java.

    Let’s be honest, people are made to talk. And that’s precisely the reason for the massive proliferation of software aimed at providing real time communication between users. Instant messaging programs rule all the way, when it comes to being in touch with other people. However, for fully web-based applications, things have been a little different. As I mentioned before, http-based chat programs were most of the time built as old Java applets, because of their relative ease to be included within web pages, simply by fetching the appropriate Java files and wrapping them into deprecated <applet> tags.

    Fortunately, on today’s Web, developers have a wider range of options for developing chat applications, without the need to be a seasoned Java programmer. Server-side scripting languages such as PHP or ASP make it fairly easy to build chatters with a decent level of responsiveness. Of course, the major drawback with using these languages in developing pseudo real-time communication programs was the natural inability to make http requests in the background, without dealing with page reloads. As a result, most of these applications involved the use of refresh meta tags for updating the contents of the chat.

    As you may have guessed, in this article I’ll attempt to develop a chat application by using AJAX as the workhorse for sending out http requests without involving page reloading. Through this first tutorial, I’ll draw the general guidelines for building this application, along with writing down some of the JavaScript functions that will compose the complete program. Hopefully, by the end of this series, you will have a pretty clear idea of how the chat works, and certainly of the possible improvements that can be introduced into the original application.

    Have I caught your curiosity about building an AJAX-based chat? Fine, let’s get started.

    More XML Articles
    More By Alejandro Gervasio


       · The capabilities of AJAX for developing Web applications that resemble desktop...
       · The method you are using for AJAX really limits your audience since you are using...
       · Hello,Thank you for commenting on the article. With reference to your opinion,...
       · Well written. Thank you.
       · Thank you for the kind comments on the article. Very much...
       · Hi. Your chat seems to be interesting though i didn't manage to put it working...
       · Hello Paulo,Thank you for commenting on my article. I've tested my chat...
       · Thanks for the great articles, I'm in the process of designing a user-to-user chat...
       · Thank you for your kind comments on my articles. I'm really glad to know that you're...
       · HiIt is very interesting and excellent. I am going to implement based on your...
       · Hello Upen,Thank you for the compliments on my AJAX article; they’re really...
       · Hai I am also thinking to implementing .do you give your code.I am also help...
       · Thank you for commenting on my AJAX article. Concerning your question, you can...
     

    XML ARTICLES

    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands
    - Creating an XUL App Installer
    - Overlays in XUL
    - Skinning Your Custom XUL Applications






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway