Thanks for your reply. Sorry for giving such a short question and for not posting code or more details. I am really looking for insight on when readyState WOULD EVER == 3 (I used all caps for emphasis not for yelling).
In my situation, I was using a remote server for the request and it was "async". The server side script was taking ~8 seconds to send it's response and it's response was ~18k. I have read that sometimes it is possible to read the "stream" from an AJAX call by checking for readyState to be equal 3 and setting an interval to check xhrObj.responseText periodically. This is a method used in Multipart XHR where you can load multiple images, css or js files using base64 encoding. Anyways, I was hoping on using this method to create a loading bar on the UI to show progress. To say the least I didn't get my result, but while debugging I logged some activity in the browser console and noticed that only sate 1 and 4 would fire "onreadystatechange()". I got these results on Firefox and Chrome browsers. So this brought up my question, which is why I am posting here. Excluding IE 6 and 7 (which do not support readyState 3), under what circumstances is readyState equal to 3. I know the state is meant for "downloading", but does it depend on a certain request header to be set, the size of the response or a time limit being reached for the server to respond? I see that MXHR may not be the solution for my situation, but I would like to see in what scenario I might be able to use it. I know the best javascript developers in the world are in this community, this is why I ask here. ;) On Jan 10, 6:38 pm, Diego Perini <[email protected]> wrote: > On Jan 10, 11:44 pm, Arlo <[email protected]> wrote: > > > I am trying to use readyState == 3, but it is apparently never fired. > > I only see 1 and 4 being fired. Is there some sort of requirement > > needed for state 3 to be fired (besides browser support)? > > I am not sure what you are trying to achieve nor the way you are doing > it but I believe that to remain cross-browser safe (and if that it is > not mandatory for your objectives) you should only use "readyState == > 4". > > If you need more help from people here you should at least specify > your environment and maybe show an (reduced) example of what you are > trying to do. > > Is that a "local" or a "remote" page/server you are testing with ? > > Are you using "sync" or "async" requests ? > > Without those minimal guidance, answering is like shooting in the > dark :) That's what I did. > > -- > Diego -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
