Jump to content

ajax chat


djp1988
 Share

Recommended Posts

AJAX is one method to make chatrooms, but the most common one is to have Flash and Java clients connect to server applications through sockets.If you're making an AJAX chat, just update the content by calling the request over and over with setInterval()

Link to comment
Share on other sites

I built a chat room once. I kept the whole transcript in a file on the server. When the client asks for an update (per Ingolme's method) it POSTs the number of characters it currently has. The server script then uses that as an offset for reading the file and returns only the characters beyond that point. When the client receives them, it just appends them to the div in which the text is displayed. No flashing.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...