Click to See Complete Forum and Search --> : So how taxing for a server is it to have an Ajax script run every second?


sois
01-08-2008, 01:31 PM
Say I want to build a chat program... what is the best way to do this where the lastest post gets displayed immidiately?

Does php or javascript have trigger functions that push information when an even happens?

For example, is there any way to notify me if a page is get a new message (or something similar) while I am on the page? For example, lets take this forum as an example. If I submit this page and leave the page up, are there any technologies that can show me a "pop up" window or something when a new message is posted?

I think gmail does this, how is this accomplished if so?

Sorry for the ramble, I am trying to get a little more information before I build anything stupid.

Thanks all.

JPnyc
01-08-2008, 04:17 PM
There has to be a better way. I don't really know the specifics of how you're accomplishing this, but there has to be a better event handler than a recursive time-based one.

sois
01-08-2008, 05:08 PM
If anyone knows or can point me to a good chat system (even if not php) let me know, I am interested in how this works.

I know something is possible with internet chat software like Meebo.

trevorsg
01-12-2008, 10:25 PM
I know that Gmail does do this, but as far as I know, Gmail makes regular requests (a few times a minute) to check for new mail; I don't think it's triggered by the presence of new mail.

You might want to check out phpMyChat http://www.phpheaven.net/phpmychat:home