PDA

View Full Version : Sencha Touch AJAX Call Issue - Getting response Code 0



pras_mi
19 Aug 2011, 1:33 AM
Hi All,

I am using the following code for making a AJAX Call:


Ext.Ajax.request({
url: <Some HTTPS URL>,
method: 'GET,
headers: {
'Cookie' : <Some Authentication Cookies>
},
success: function(response, opts){
// More programming logic here
},
failure: function(response, opts){
console.log('Ext AJAX call failure with status code ' + response.status);

}
});

Most of the times it returns proper response but sometimes it is returning status code 0. I am sure that the URL I am calling is up and responding.
If anyone has faced any similar issues then please let me know your findings, what could be the possible cause of this AJAX call to be failing that too with status code 0 ?

Thanks in Advance.

--Prashant

fx-mike
19 Aug 2011, 2:05 AM
What platform is causing this problem for you?

I have had this problem on iOS in phonegap, see this post:
http://www.sencha.com/forum/showthread.php?140109-Sencha-example-retrieving-data-via-a-local-text-file-rather-than-a-json-url-proxy.&p=630760&viewfull=1#post630760

tierrarara
20 Aug 2011, 5:33 PM
when the device no iternet connection present, test your internet connection.

1) disconect your internet, later execute ajax connections -> response.status = 0

fx-mike
22 Aug 2011, 12:23 AM
I'll have to watch out for that then, thanks for the hint.
Though getting response.status 0 is not an indicator for being offline.