views:

68

answers:

0

Hi folks, I want to access open api through ajax in mobile application, its work fine in iphone but does not working in android phone-gap app, returning error->"error message-null,typeerror-Result of expression 'data'[null] is not an object and error status-parsererror" ,is there any browser setting,thanks in adavance.

$.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);  
   }
});

mayur birari