I've been stuck here for quite some time now. I am developing a mobile application with phonegap. I have tested the app with android 4.0.4 and it is working perfectly fine. However, when I tested on 2.2.3, the AJAX ended with and error state of:
ready state = 0
HTTP Status = 0
I have tried to increase the timeout to be really long but it still ends with that result. I am not sure what is the problem but I have developed another app using the same ajax call and it is working fine on android 2.2.3 but what makes this time different is that it calls to a SAML URL (Identity Provider).
the codes is like bellow:
$.ajax({
                url: "...."+Math.random(),
                type: "POST",
                data: {
                    j_username: uname,
                    j_password: pword
                },
                cache: false,
                timeout: (100*1000),
                success: function(data, textStatus, jqXHR){
                    var contentType = jqXHR.getResponseHeader('Content-Type');
                    if (contentType == 'application/atomsvc+xml'){
                    }else{
                        alert(".....");
                        // clearTimeout(timer);
                        $.mobile.hidePageLoadingMsg();
                        enableAllButtons();
                    }
                },
                error: function(jqXHR, textStatus, errorThrown){
                    // clearTimeout(timer);
                    alert("Error Thrown : " + errorThrown);
                    alert("status : " + jqXHR.status + " " + jqXHR.statusText);
                    alert("ready state : " + jqXHR.readyState);
                    alert(".......");
                    $.mobile.hidePageLoadingMsg();
                    enableAllButtons();
                }
            });  
Really hope someone can help me with this.
Thank you very much for your input in advance.
Regards,
Amanda
 
    