I want to access open API through ajax in mobile application, its work fine in iphone but does not working in Android phonegap application:
returning error->"error message-null,typeerror-Result of expression 'data'[null] is not an object and error status-parsererror"
Is there any browser setting need to follow.
I want to call the web service in android-phonegap application:
$.ajax({
url:'stringURL',
beforeSend: function(x) {
x.setRequestHeader('Authorization','username/pwd');
},
dataType:"xml",
contentType:'application/xml',
timeout:10000,
type:'POST',
success:function(data) {
alert(data);
},
error:function(XMLHttpRequest,textStatus, errorThrown) {
alert("Error status :"+textStatus);
alert("Error type :"+errorThrown);
alert("Error message :"+XMLHttpRequest.responseXML);
}
});