On Mar 25, 2009, at 4:32 AM, comslash.com wrote:

I believe you can set the value to null or 0 to not have the request
time out ... but you may want to implement something on error instead
of this to say attempt the search again x times then print msg server
is busy or something along those lines.

But AFAIK the onError is never called when a script times out, right? No response means no error?

I have had lots of problems with this, trying to make a reliable way of doing AJAX queries, even on slow connections/servers. I ended up using an AJAX manager (there are some nice jQuery implementations for it), and use a manual timeout (setTimeout) that aborts and retries the call (you can do this say three times and then give up, or loop infinitely). Whenever the onSuccess is called, I stop the manual timeout (so the abort is never called). This way I make sure the call is finished, and I get to print some nice messages to the user when things take too long.

I'd recommend using some sort of AJAX manager for sites with lots of AJAX queries.

Regards,
--
Martijn.

Reply via email to