You are here: Re: Cant figure out ajax/php problem. « PHP Language « IT news, forums, messages
Re: Cant figure out ajax/php problem.

Posted by Rob on 12/20/07 15:29

On Oct 22, 4:37 pm, "Steve" <no....@example.com> wrote:
> "John Doe" <d...@dad.cog> wrote in message
>
> news:02783240$0$29357$c3e8da3@news.astraweb.com...
>
> > 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.
>
> it does no one any good to ficticously guess at what your problem is, and
> feckless to divine a solution.
>
> here is what i can say...this is NOT a php question. further, if you just
> want to load the html/page again, you don't need javascript to do that! you
> need to isolate functionality and use xml to communicate messages to/from
> the server, and then use javascript to update only the pertenant area(s) or
> the current page in the browser.
>
> either ask your *javascript* question in a *javascript* newsgroup, or get
> flak here. either way, no one will do shit for you until you post sample
> code.

John, assuming you're using 'prototype' for your AJAX, it has a
"evalScripts: true" parameter - have you set this?

If not, you may be running into the same problem that this parameter
tries to deal with.

Either way, I would suggest converting your code to use prototype.
You can then call your <div> content in a single line of code, and not
have to worry about what's going on in the background too much.

Rob.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация