I have a script for chatting that Used Ajax,
I would like to do a monitoring script in order to allow the administrator to see all exchanges between users.
The thing is that I did not find any script that explain how to receive data from databse with no reload of the page.
If anybody could help me to find that script or give me a tutorial to build it I’ll be glad.
Receive All my utmost Respect.
Kind regards.
SP.
You are using ajax.. the whole concept of ajax is not having to reload the page…
The best tools for the job are:
Socket.io (written for nodeJS) is a probably the best for the job. It leverages the right transport (websockets, longpolling, server-sent events, flashsockets, ajax polling) for you and will give you the best performance available.
Here are a couple php js implementation examples:
using Server-sent DOM events (not cross browser):
updates +/- every 3s
using jQuery ajax request: will send a request every 1000ms
using phpWebsockets: lib + codesample