How to create web chat?

How can I create a chat in my web site

  • I have a web site where users register to access the content of the web site. I want to create a chat like Facebook. So when a user clicks on a button called "CHAT," it displays a list of users that are online, and so he can chat with other users. Please give me a suggestion how to create a chat like this in AJAX and jQuery. Please help me.

  • Answer:

    Meebo rooms might be the easiest way: http://www.meebo.com/rooms/

eni at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

One way could be to use a java/javascript irc client and set up a channel for your site

kskjon

with PHP and ajax, you will have to store the chat on the server, e.g. in a mysqltable with this columns: id from_user to_user time message read If a user writes a message, it will be written in the table by a ajax request. To recieve a message you need to send requests to the server permanently where you ask whether there are new messages for actual user which are not read, send them to the user and mark as read(eg with timestamp, so you can delete history after one week if read),

Tokk

Using google I found for example this http://css-tricks.com/jquery-php-chat/ to create dcfhat using jquery/php. It does use polling so it isn't really realtime and you server can not cope on high load(100+ connections or something). You could integrate something like http://www.speeqe.com/ on your site. it would be best to write something like this using http-streaming/long-polling, but this can't be done efficiently in php. Java has a real nice library to do this called https://atmosphere.dev.java.net/

Alfred

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.