Reply to Re: window.setTimeout equivalent in PHP?

Your name:

Reply:


Posted by Csaba Gabor on 09/03/07 15:50

On Sep 3, 3:14 pm, shimmyshack <matt.fa...@gmail.com> wrote:
> Cant you just fire the navigate() method, then sleep for $timeoutTime
> and then execute onDocumentComplete or similar, assume that if it
> doesn't return true that you are safe to fire an error.
....

Hmmm, this excellent suggestion bears a little more thought.
Let's suppose I have $ie go from page1 to page2 to page3
What it means is that inside the downloadComplete event handler for
page1 I'm going to do, per your suggestion, something like:

$callback = "callback2";
downloadComplete_handler_hookup_to_callback ($ie, $callback);
$ie->Navigate2 ("http://page2.com");
while (time()<$timeout) { com_message_pump(200); }
call_user_func ($callback);

Under the assumption that the page finishes promptly (the usual
scenario), I'll have the interesting situation that that event handler
will be invoked twice, concurrently. Once because the previous
invokation is still waiting for the timeout, the second because the
new page will have finished.

If this were Navigate2, then I would not be sanguine about the
chances, since Navigate2 is cancelable. I'm guessing that
downloadComplete should be OK. It will be interesting to see how it
works out.

Csaba Gabor from Vienna

[Back to original 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

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