javascript chat room tutorial ?!?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

javascript chat room tutorial ?!?

Post 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-
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

Moved to Client Side, where it belongs :x
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

ok, well... where do I find out how to make a Client Side (JavaScript) one myself?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

read up on xmlhttp objects.
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...
Jr
Forum Commoner
Posts: 99
Joined: Mon Mar 07, 2005 3:25 pm

Post by Jr »

hmm... i appriciate the post but could you explain this in 'newbie' terms? I really dont understand quite how this works. :oops:
bobsta63
Forum Commoner
Posts: 28
Joined: Thu Apr 21, 2005 7:03 pm
Location: Ipswich, UK

Post 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/
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
Post Reply