The image should take care of the click, and also reduce the amount of
information transmitted somewhat (although not necessarily, depending on
what you send to your iframe).

Cheers,


Marco

On Mon, 2003-06-30 at 14:09, Jeremy Thibeaux wrote:
> > [snip]
> > I have a chat script. I want it to refresh the chat
> > display area
> > whenever there is a new message posted, but not
> > every 10 seconds or so.
> > How could I get the script to refresh only when
> > there is a new entry
> > into the database table?
> > [/snip]
>  
> I have implemented something along these lines for an
> online chess game (so the board would only refresh
> when the other player moves).  It did require a loop,
> as suggested.  I used a hidden IFRAME to check the
> data.  Basically, I would refresh the page referred to
> by the IFRAME every 10 seconds or so, and this page
> contained JavaScript that invoked a function on the
> containing page.  The JavaScript function on the
> containing page would then refresh the page when the
> parameter passed to it indicated that the other player
> had moved.  I did implement the site using PHP, but
> this really isn't a PHP specific approach.  
> 
> I imagine you would do something very similar for chat
> (in fact, I had been considering implementing it for
> the online chess site so that the users could send
> messages to each other during the course of the game).
> 
> And there is a performance issue if you are going to
> support a lot of users at one time; however, at least
> it is not as bad as refreshing the entire page every
> 10 seconds (this would be particularly disastrous for
> my chess board, which contained many images).
> 
> There are a number of references that talk about this
> trick if you search on "iframe rpc javascript" in
> google:
> 
> http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=iframe+rpc+javascript
> 
> You will still get the clicking, tho.  But users' can
> disable it if it annoys them -- sometimes it is nice
> to know that something is going on.
> 
> Hope this helps.
> 
> Jeremy
-- 

Marco Tabini
President

Marco Tabini & Associates, Inc.
28 Bombay Avenue
Toronto, ON M3H 1B7
Canada

Phone: (416) 630-6202
Fax: (416) 630-5057
Web: http://www.tabini.ca


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to