Page 1 of 1
javascript chat room tutorial ?!?
Posted: Wed Apr 20, 2005 2:22 pm
by Jr
Ok, I think I've officially looked everywhere on the internet and I can't find anywhere that has a JavaScript chat room tutorial. I have found php ones but they have to update every so often and they just wont work. If anyone knows of a good tutorial that would be awsome.
Thanks,
Jr-
Posted: Wed Apr 20, 2005 2:24 pm
by nigma
Moved to Client Side, where it belongs

Posted: Wed Apr 20, 2005 2:42 pm
by Jr
ok, well... where do I find out how to make a Client Side (JavaScript) one myself?
Posted: Wed Apr 20, 2005 5:29 pm
by feyd
read up on xmlhttp objects.
Posted: Thu Apr 21, 2005 1:31 pm
by magicrobotmonkey
yea that will be tough, because javascript is client side. you can send messeges to the server easy enough, but i dont know how you'll get them back without some sort of timely check.
Posted: Thu Apr 21, 2005 1:38 pm
by Chris Corbyn
Hmm... webmessenger (
http://webmessenger.msn.com/) uses xmlhttp doesn't it?
Also, e-messenger (
http://www.e-messenger.net/) is purely JavaScript based (on the client side I mean).
The javascript part is only a small part of such an application though.
Most of the work will still have to be done on the server. The JS merely provides a plesant way to interact with the server.
Posted: Thu Apr 21, 2005 4:26 pm
by timvw
here is a little sample i made a couple of months ago...
http://timvw.madoka.be/programming/php/chat_server.txt
http://timvw.madoka.be/programming/php/chat_client.txt
http://timvw.madoka.be/programming/php/chat_dump.sql
but i don't think it's that hard to place a irc/msn/whatever backend in place of the mysql database...
Posted: Fri Apr 22, 2005 3:51 pm
by Jr
hmm... i appriciate the post but could you explain this in 'newbie' terms? I really dont understand quite how this works.

Posted: Fri Apr 22, 2005 4:00 pm
by bobsta63
Try this mate it is Java Powered, and is powered from their site,
Dont know if this will help at all, but is an alternitive.
http://www.parachat.com/
Posted: Fri Apr 22, 2005 4:50 pm
by timvw
well, you need the
http://jpspan.sf.net library.
it offers you a connection between php and javascript through xmlhttprequest.
you can read up the details on that site... and try some of the examples to get a better view on the technology...
i wanted to give it a try, so i made a little shoutbox/chat name it whatever you want to name it using that library.
it comes down to writing the "server". this is the php stuff that handles the xhtmlrequest... and then i wrote a "client" that will send xmlhttp requests (and reload the chatbox if new messages are available). (imho) this gives a much smoother impression than reloading the complete page.
hth