ajax im is an ajax chat script that creates a real-time chat environment with a browser based interface.

It can be added to any intranet, website or a social-community project to help users chat with each other. Chat interface does not reload as everything is updated in real-time via JavaScript.

ajax im is also a multilingual script and language files can be found in the script website.

Ajax Chat Script

How ajax im works?

The XMLHTTPRequest object allows HTTP requests to be sent to the server and get input back from the server. There are two parts to the client-server interaction through this object:

  • The client "pings" the server (a PHP script) for new messages. The server in turn queries a database for any messages for the client, and returns them as JSON. The XMLHTTPRequest object passes this JSON text be parsed by the rest of the JavaScript.
  • The client sends data to the server (a PHP script), such as a new message to another user. This data is then processed by the server ("cleaning" the data of any thing invalid) and put into the database, which is later "pinged" by another client.