XML
  Home arrow XML arrow Building an AJAX-Based Chat: Coding the Re...
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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 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: Coding the Receiver Module
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2005-11-15

    Table of Contents:
  • Building an AJAX-Based Chat: Coding the Receiver Module
  • Retrieving messages from the database: defining the “getChatData()” function
  • Building the chat layout: writing the “createMessageBoard()” and “createMessageBox()” functions
  • Registering chat users: defining a simple login page
  • Putting the pieces together: building the whole chat page

  • 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
     
     
    ADVERTISEMENT


    Building an AJAX-Based Chat: Coding the Receiver Module


    (Page 1 of 5 )

    In this second part of a three part series of articles, you will learn a lot more material related to building the AJAX-based chat. You will discover how two requester objects fetch or add new messages to the database. Also, you will see the code for a simple login page for registering users that want to access the chat page.

    This is it. The stuff you were waiting for! Welcome to part two of the series “Building an AJAX-based chat.” As I hopefully demonstrated in the previous article, building a chat application doesn’t demand that you be a seasoned Java programmer or even an expert developer working with IRC servers. Armed only with a basic knowledge of AJAX and JavaScript, it’s possible to create a simple (but extensible) chat program, which can be easily customized and integrated with existing Web applications, without suffering maintenance headaches.

    Before I leap forward, it’s worth a brief look back to remind ourselves of the goal of this series. As you probably remember, in the first tutorial I wrote some of the JavaScript functions that make up the chat application, focusing particularly on the development of the “sender” module. This module is responsible for handling the requests for inserting new messages into the database table, together with updating the display of messages.

    Throughout this second article, attention will be turned to writing the functions that compose the “receiver” module of the chat, which also uses a “receiver” requester object for retrieving the list of user messages from the database. In addition, I’ll show a couple of complementary functions, aimed at building the basic layout of the chat itself, as well as a basic login page for registering the nicknames of chat users. Hopefully, by the end of this article, you’ll have a clear idea of how both program modules fit into the whole application, in order to turn it into a fully working web-based chat.

    Having established the goals of this tutorial, it’s time to move forward and start coding the chat’s receiver module. Let’s get going!

    More XML Articles
    More By Alejandro Gervasio


       · Over this second article, the "receiver" module of the chat application is properly...
       · This is my first foray into AJAX and DOM, and I this tut was the best place to...
       · Thank you for your compliments on my AJAX tutorial. I'm really glad to know that...
       · Nice articleIsnt it bad pratice to call a function recursively without ever exiting...
       · Thank you for commenting on my article. Comming to your question, recursion can be...
       · Nice article,It would be great if they had a link to an example at the beginning...
       · Thank you for the kind comments on my AJAX tutorial. Of course, when applicable,...
       · Nice article & very interesting, since I have been looking for a thorough, detailed...
       · Hello Rasmus,I'm glad to know that my AJAX chat was what you were looking for....
       · I loved your article. It helped me understand AJAX more. BUT, this does not want...
       · Thank you so much for the kind comments on this tutorial. It's good to see it's been...
       · Nice article. I had just finished my own AJAX chat tutorial when I ran across yours....
       · I'd like to thank you for commenting on my AJAX-based chat tutorial, particulary if...
     

    XML ARTICLES

    - Using Regions with XSL Formatting Objects
    - Using XSL Formatting Objects
    - More Schematron Features
    - Schematron Patterns and Validation
    - Using Schematron
    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - 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







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek