- From: David Arthur <mumrah@gmail.com>
- Date: Tue, 13 Jun 2006 16:29:28 -0400
- To: public-webapi@w3.org
- Message-ID: <9e99bb250606131329vf3644fj682729e307cf9c82@mail.gmail.com>
how about a retry method?
so maybe one could do this.
xhr.open("GET",url,true);
> xhr.onreadystatechange = function(){
> if(xhr.readyState == 4 && xhr.status == 408)
> {
> //code for timeout
> xhr.retry();
> }
> xhr.send(null);
I've been writing some error handling for XHRs and in order to do something
like this, i'm having to make a bunch of extra properties for the class
(getting kinda messy). I thought having a simple way to retry a request
would be nice.
Another possibility would be to let the constructor take on an argument such
that it could clone an existing XHR
var xhr1 = new XMLHttpRequest(xhr0);
Where it would take on the properties of the opener from the cloned XHR -
readyState, status, statusText, etc would be reset. And the readyState
handler would also be not set (as not to get stuck retrying a request ad
nausium).
Just a thought.
--
David Arthur
http://enja.org/david
Received on Tuesday, 13 June 2006 20:29:45 UTC