0

I have a hybrid mobile application which works on both android and ios devices.

The problem with it is that the application works fine when run on Android. However, there is a Network Error: XMLHttp Request Exception 101: saying server is unresponsive while running the application in iOS.

The application uses Cordova 2.9

I have been trying out solutions like setting async to true(initially it was false). But it does not solve my issue.

Can you please tell me the reason and the solution to be provided.

Thanks.

Devika R
  • 1
  • 2

1 Answers1

0

Make sure that you are using JSONP data format in IOS. This same as Json, but a callback function is needed.

Hephze
  • 1
  • 3
  • Thanks for your reply Hephze...but I have tried it but it does not help.Anyways it is working fine in Android. Why should i opt for JSONP only for iOS? – Devika R Aug 11 '16 at 09:04
  • Hi Hephze, Somehow now i feel like I have not written the JSONP format correctly.. Can you please elaborate on the method specified. – Devika R Aug 11 '16 at 10:34
  • Here is an example: `$.ajax({ type : "POST", url : "ww.abc.com", contentType: "application/json; charset=utf-8", crossDomain: true, data : {}, dataType : 'jsonp', jsonp: false, async: false, jsonpCallback: "functionName", success : function(response) { }, error : function() { } });` – Hephze Aug 16 '16 at 10:11