I'd like to see more pages doing this kind of thing.
One thing you can do is to have an IFrame and set its source to be something like
mydomain.com/perhaps/a/directory/statusChecker.php?some=arguments&go=here
On the server side, you will then realize that this is a directive to check some status.
If it's ready, return appropriate data, otherwise send back a not ready message.
This sending back data/message is actually a page which has an onLoad
which knows about its container document (the original page)
and can access the necessary functions.
You'll have timing issues (but then again, that's your whole
reason for doing this). In particular, You'll have to have some
timeout and set semaphores in case the server or connection
goes belly up, or the response time is longer than expected
and then returning.
Good luck,
Csaba Gabor from New York
PS. You can do one way communication by setting the src on
IMAGE elements, but you have said that you actually want
returned information.
You would think that you could just load a new SCRIPT element
instead of needing to suck up pages, but I have not gotten this
to work, especially cross platform. I'd be happy to read about
other peoples' approaches.
"Bryan Field-Elliot" <br***@netmeme.org> wrote in message news:3LQ9b.481514$o%2.214880@sccrnsc02...
We're designing a web app in which some operations will take a long time
to complete (maybe two minutes). Because it's a high-volume application,
we don't want browser connections hanging open for these two-minute
intervals; that would cause a huge resource drain on the server (open
threads, etc.).
We've implemented a page which has a <meta refresh> tag in it of 15
seconds, so that the browser can "check back" with the server every so
often to see if it's done with this operation.
However, we don't like the constant page reloading.. We'd rather script
this as a javascript "background process" if this is possible...
My question is, is there a way to script some kind of page reload in
Javascript, which is done without any visible window on the screen? I'd
script it to reload every 15 seconds or so, until (for example) the text
"OK" appears in the <body> tag (or some other indicator), which would
then signal the main page to reload.
Sorry if this is a tortuously confusing question. Appreciate it if you
got this far and can offer any suggestions.
--
Bryan Field-Elliot
http://netmeme.org