PDA

View Full Version : How to calculate ajax request time in certain period before response comes.



Manoj Parida
8 Jan 2013, 2:43 AM
Here is an ajax request to backend




// Ajax request
Ext.Ajax.request({
url : 'http://localhost:8080/myapp',
method: 'GET',
params: {
paramId:paramId
},
success: function(response, opts) {
var result = Ext.JSON.decode(response.responseText);
},
failure: function() {
console.log('failure);
}
});


for getting response it takes 60 seconds,here i want to show a pop up after 30 seconds of request and also it should be working for every ajax call as in application there are so many request are sent through this ajax call.
If there is a response which is getting at 15 seconds,in this case no pop up message will shown.

So how to calculate ajax request time and in certain period of request time,pop up will show otherwise not.

Any helps appreciated.

Thanks & Regards
Manoj Parida

Manoj Parida
9 Jan 2013, 11:11 PM
Please help someone to me about this :-/