[Webkit-unassigned] [Bug 10638] New: XMLHttpRequest on Windows doesn't give correct status

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Wed Aug 30 05:34:49 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=10638

           Summary: XMLHttpRequest on Windows doesn't give correct status
           Product: WebKit
           Version: 420+ (nightly)
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: major
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: karthikkumar at gmail.com


When an XMLHTTPRequest object's readyState is 4, it doesn't give me the correct
server status (request.status element).. It is null instead of a value like
200, 301 or something. 

sample code to test: (tested in Firefox/Opera/IE)

     function processResponse(httprequest){
         var response=null;
         if(httprequest==null) return response;
         if(httprequest.readyState>0&&httprequest.readyState<4){
                showAjax();
         }
         else if(httprequest.readyState==4) {
                hideAjax();
                if(httprequest.status == 200) {
                        var
responsewrapper=getJSONObject(httprequest.responseText);
                        authenticated=false;
                        if(responsewrapper!=null) 
                                response=responsewrapper.response;
                        if(response!=null) {
                                        authenticateResponse(response);
                                        errorResponse(response);        
                                        return response;
                        }       
                        showStatus(STATUS_ERROR, "JSON Error: Couldn't read
response.");
                }
                else 
                        showStatus(STATUS_ERROR, "AJAX Error: Server HTTP
status: "+httprequest.status); //Note this: XXXX
        }
        return response;
    } 


//XXXX: throws: AJAX Error: Server HTTP tatus: [undefined] in Swift

the callback to XMLHTTPRequest is: 

...
var httprequest=makeHTTPRequest(); //returns object successful
httprequest.onreadystatechange=function (){ processResponse(httprequest); }

...

httprequest.open("GET", url, true); //Last parameter is true.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list