PDA

View Full Version : How to find out an Ajax call has timeout



webfriend13
4 Jun 2012, 10:50 PM
Hi All,

We can send Ajax request using Ext.ajax.request. The timeout for the request can be specified by using timeout config. We also have success and failure method. Is there any way to know that the call has failed because it got timedout ? :-?





Ext.Ajax.request({
url: 'page.aspx',
timeout: 60000
});

webfriend13
4 Jun 2012, 11:02 PM
Use response parameter of failure method. It has timeout property. If request has timedout, it will be set as true




Ext.Ajax.request({
url: url,
timeout: 24000,
success: function (result, request) {

}, //success
failure: function (response, opts) {
if (response.timedout) {
//do something
}
}
});

nitingautam
4 Oct 2013, 4:39 AM
is this available in ExtJs3 also ?


response.timedout