Re: [xmlhttprequest2] timeout and JSON

Jonas Sicking wrote:
> Sunava Dutta wrote:
>> XDR timeout doesn’t work with sync requests as there is no sync 
>> support in the object.
>> I'd be thrilled if IE9's timeout property be adopted for XHR. (OK, 
>> thrilled would be an understatement!)
>> http://msdn.microsoft.com/en-us/library/cc304105(VS.85).aspx
>>
>> We fire an ontimeout and named it similar to other defined XHR2 events 
>> like onload etc to ease potential integration  with XHR2! It works for 
>> sync and async calls. Of course, if needed we are amenable to making 
>> tweaks down the road to the property/event behavior if necessary, but 
>> ideally it would be picked up 'as is'.
> 
> How do other properties, like .readystate, .responseXML, .responseText, 
> .status interact with timing out? I.e. say that we have an XHR object 
> currently loading in the following state:
> 
> xhr.readystate = 3
> xhr.status = 200
> xhr.responseText = "<result><el>hello worl"
> xhr.responseXML = #document
>                     <result>
>                       <el>
>                         #text: "hello worl"
> 
> (sorry, trying to draw a DOM, not very obvious what it is)
> 
> What happens if there is a timeout in that state?
> 
> 1) .readystate is set to 0
>    .status is set to 0
>    .responseXML is set to null
>    .responseText is set to ""
> 2) All properties are left as is.
> 3) Something else  (Profit?)
> 
> If the answer is 1, does that happen before or after ontimeout is fired? 
> And does that mean that onreadystatechange is called?
> 
> If the answer is 2, does this mean that no action at all is taken other 
> than ontimeout getting called? onreadystatechange is not fired any more 
> unless someone explicitly calls .abort() and then .open()?

To make it clear. I absolutely agree that it would rock if we could use 
the MS implementation. However it needs to be specified in more detail 
than the MSDN page includes, such as answers to the questions above.

/ Jonas

Received on Thursday, 11 September 2008 10:22:20 UTC