trying to write php/ajax instant messenger.
trying to write php/ajax instant messenger.
am 22.10.2007 08:06:06 von john doe
Here's my issue: I have an instant messenger type feature for my site, its
basically an ajax IM feature. I run with a mysql backend on the site, i have
a div on my main page that runs a javascript timer to load the php page via
ajax every 15 seconds which checks the "pinguser" table to see if the user
has any chat requests, then echoes them to a div on the page. what i REALLY
want to do is have the ajax page see if there is a ping for the user, and if
so, pop up a javascript alert or somethign to let the user know he has a
chat request. I tried just echo'ing the javascript to do an alert(); , or
even a window.open. It works if i just run the script by itself, but when it
runs in the div on my main page, i get the rest of the feedback (it displays
the message i echo'ed that said "youve got mail", but the alert box doesnt
pop up. Anyone have any idea what Im doing wrong? I've been googling for 3
days straight and going crazy, never thought to check the groups before.
Re: trying to write php/ajax instant messenger.
am 23.10.2007 02:13:06 von nothingsoriginalontheinternet
I don't have a direct solution for your problem, but I have a
suggestion. Complex AJAX interfaces are easier to create with one of
the various JavaScript frameworks. One of these is Dojo:
http://dojotoolkit.org/
AOL's AIM Express is built on Dojo (or at least it makes use of it -
look at the source).
-Michael Placentra II
On Oct 22, 2:06 am, "John Doe" wrote:
> Here's my issue: I have an instant messenger type feature for my site, its
> basically an ajax IM feature. I run with a mysql backend on the site, i have
> a div on my main page that runs a javascript timer to load the php page via
> ajax every 15 seconds which checks the "pinguser" table to see if the user
> has any chat requests, then echoes them to a div on the page. what i REALLY
> want to do is have the ajax page see if there is a ping for the user, and if
> so, pop up a javascript alert or somethign to let the user know he has a
> chat request. I tried just echo'ing the javascript to do an alert(); , or
> even a window.open. It works if i just run the script by itself, but when it
> runs in the div on my main page, i get the rest of the feedback (it displays
> the message i echo'ed that said "youve got mail", but the alert box doesnt
> pop up. Anyone have any idea what Im doing wrong? I've been googling for 3
> days straight and going crazy, never thought to check the groups before.
Re: trying to write php/ajax instant messenger.
am 23.10.2007 12:45:29 von Captain Paralytic
On 22 Oct, 07:06, "John Doe" wrote:
> Here's my issue: I have an instant messenger type feature for my site, its
> basically an ajax IM feature. I run with a mysql backend on the site, i have
> a div on my main page that runs a javascript timer to load the php page via
> ajax every 15 seconds which checks the "pinguser" table to see if the user
> has any chat requests, then echoes them to a div on the page. what i REALLY
> want to do is have the ajax page see if there is a ping for the user, and if
> so, pop up a javascript alert or somethign to let the user know he has a
> chat request. I tried just echo'ing the javascript to do an alert(); , or
> even a window.open. It works if i just run the script by itself, but when it
> runs in the div on my main page, i get the rest of the feedback (it displays
> the message i echo'ed that said "youve got mail", but the alert box doesnt
> pop up. Anyone have any idea what Im doing wrong? I've been googling for 3
> days straight and going crazy, never thought to check the groups before.
See Steve's answer to your other post!