PDA

View Full Version : Capture Ext.Ajax timeout error



chinj
21 Feb 2011, 3:18 AM
'Uncaught TypeError: Cannot read property 'status' of undefined'

I got the above error while I wrote a Ajax timeout code.



var submitDatatoServer = function(url,data,successcallback,mask,loadText){
loadText = (loadText) ? loadText : 'Downloading…';
if(mask){
Ext.getBody().mask(loadText,'loading',true);
}
Ext.Ajax.request({
url: url,
method: 'POST',
timeout: 10000,
params:{
data:data
},
success: function(responseObject, opt) {
successcallback(responseObject);
},
failure: function(responseObject,opt) {
Ext.Msg.confirm('','Retry?', function(){
submitDatatoServer(url, data, successcallback, mask, loadText);
});
}
});



On failure, I got responseObject.status as 0 and the error message "'Uncaught TypeError: Cannot read property 'status' of undefined'". Please help.