Open GoogleCodeExporter opened 8 years ago
sorry for the wrong code
this one is right
xhr.onreadystatechange = function() {
//QUESTION: Why can't I use this.readyState?
try{
if(xhr.readyState == 4) {
if(xhr.status!=200){
throw Error(xhr.status + ' '+xhr.statusText );
}
//XML-RPC
if(instance.__protocol == 'XML-RPC') {
var response = instance.__getXMLRPCResponse(xhr, requestInfo.id);
instance.__doCallback(response);
}
//JSON-RPC
else {
var response = instance.__evalJSON(xhr.responseText, instance.__isResponseSanitized);
if(!response.id)
response.id = requestInfo.id;
instance.__doCallback(response);
}
}
}
catch(e){
//err.locationCode = PRE-REQUEST Cleint
var isCaught = false;
if(exceptionHandler)
isCaught = exceptionHandler(e);
//add error location
if(completeHandler)
completeHandler();
if(!isCaught)
throw e;
}
};
Original comment by Mr.Hackie.Chain
on 8 Feb 2012 at 9:21
Original issue reported on code.google.com by
Mr.Hackie.Chain
on 8 Feb 2012 at 9:17