I want to create a chat box and I have found some snippets on internet but they look too big to understand. I have got a basic way to approach it after reading all those stuff:
Most easier way:
To update your chat window you have to pass request to the server (with Ajax), and post received data to some textarea (with id "TextAreaId" for example):
Server side should return some amount of messages (last 20 for example).
To update your chat window with some period you can use:
<body onload="setInterval('updateChat()', 1000)">
To post some message it ajax to:
And process your ajax requests on server side with PHP or ASP.
I think is better to use some text file rather than database. It reduces server loading.
There you can find a mechanizm that can help you to get reponse from server
Here you can find chat example.
Here most easier example that I find.