Updating database information output
Posted: Tue May 10, 2011 10:02 am
Hi guys, I'm not really having an issue here, I'm just to lazy to google this.
I have a " chat " ( a very sloppy prototype of a chat, anyway ) and I store all the messages in a MySQL database. The problem with outputting straight from a database in a chat is that the user will have to refresh the page every few seconds to see if someone else left a message. To work around this I used this simple method:
Sorry for the wall of text, and thank you in advance
I have a " chat " ( a very sloppy prototype of a chat, anyway ) and I store all the messages in a MySQL database. The problem with outputting straight from a database in a chat is that the user will have to refresh the page every few seconds to see if someone else left a message. To work around this I used this simple method:
<meta http-equiv='refresh' content='4'>Problem is, this looks REALLY cheap, and also has tendencies to ruin the experience for a user ( you cant scroll down to read older messages for more than 4 seconds ). So my question is: Are there any methods you could use to " stealth-ily " update the page ( sort of like Facebook is doing with their commenting system, you just see the new comments, not the entire page refreshing which means you can read older comments without being returned to the top of the page all the time ).
Sorry for the wall of text, and thank you in advance