0


I always wondered how to make an instance chat using ajax ! Ideas !? articles ?!
Thank you .

Rawhi
  • 6,155
  • 8
  • 36
  • 57

4 Answers4

3

You basically just use AJAX to "subscribe" to messages pushed by a chat server. Then the client "publishes" messages which the server pushes to any clients subscribed to that channel.

NodeJS is great for instant ajax stuff like facebooks live feed or chat (Check out this open source example).

You can also give a look at the AjaxIM project which has a chat bar like facebook and has a NodeJS server and a PHP server (I suppose you could port that over to ASP.Net). I'd reccomend going with the NodeJS server and just use the javascript library to connect to it from your project.

Christopher Tarquini
  • 11,176
  • 16
  • 55
  • 73
2

A friend of mine released a project for helping to write the backend of such a feature, it's called the LiveChat Starter Kit and is available on CodePlex. I never tried it so can't comment on its use, but it have gathered some attention there. I think it's more curtailed to commercial websites for providing online support tough.

Nicolas Buduroi
  • 3,565
  • 1
  • 28
  • 29
0

All that happens is that the javascript on the client uses ajax to send outgoing chat to the server, and the server uses ajax to send incoming chat to the client.

Of course there are a lot of different pieces involved but if you have questions about those, you should ask them.

Winston Ewert
  • 44,070
  • 10
  • 68
  • 83
  • Why AJAX? Using AJAX brings alot of load to the server. Consider JavaScript WebSockets. –  Jan 15 '11 at 17:39
  • @Time Machine, sure you are going to want to do something clever like that to deal with load. However, the question's scale is too large so I didn't want to go into details like that. – Winston Ewert Jan 15 '11 at 17:42
0

I would suggest to use XMPP as it an open standard and quite a few implementations also available, following are some links which may help:

Ajax jabber/XMPP client recommendations (real experience only please) !

http://xmpp.org/

http://www.jabber.org/

Community
  • 1
  • 1
ShahidAzim
  • 1,446
  • 1
  • 10
  • 15