AJAX Request from Phonegap Android fails

Solution 1:

You should whitelist the domain in order for your AJAX calls to work.

Add this line to config file -:

<access origin="*" />

Phonegap's default policy blocks all network access unless specified otherwise. The above line will disable this security restriction. You can also be more specific in allowing only certain domains to bypass this security feature by including the domain name in the config file like so

<access origin="http://yourdomain" />

Solution 2:

additionally to the whitelisting, make sure the cors flag is true to enable cross origin resource sharing.

$.support.cors=true;

please find the reference here