Reputation: 328
I'm new to Phonegap. I'm trying to use AJAX call in my mobile application, when i call the url, I'm getting error. No result is coming for me from the url which i'm using . when i try the same URL in browser i'm getting the result in json format.
I'm getting the error as Connection closed in the Ajax request headers.
Any suggestion are welcomed.
Upvotes: 4
Views: 2511
Reputation: 11717
Check your config.xml file in res/xml folder and replace access origin with the following code
<access origin="*" />
also check the minifest file if you have enabled the following permission:
<uses-permission android:name="android.permission.INTERNET" />
Upvotes: 4