I am working on a web application that will query the database for messages and display them in a browser. First of all, I get a list of message servers on the site, and then show the ones that are there. But then I want to use AJAX to periodically check messages and update the DOM with new ones.
However, I do not want to update the entire list. Just insert the most recent posts in the table. I use MySQL, PHP and mootools, and I really just want to hear best practice ideas on how to achieve this. Sending an array of each message identifier on the screen via AJAX and then comparing it with what is in the database is my current solution, but it seems extremely dirty.
Any suggestions are welcome.
source share