Today, my phonegap app always return 0 error code while calling ajax
Anyone has the idea?
thanks
Teo
Today, my phonegap app always return 0 error code while calling ajax
Anyone has the idea?
thanks
Teo
Here are a bunch of possibilities:
(AppStudio’s Ajax() function is a wrapper for jQuery’s Ajax function)
this is how i solve
after install app, i clear data and cache in phone setting.Then the Ajax works
In the future you can try this:
$(document).ajaxError(function (e, jqXHR, ajaxSettings, thrownError)
{
{
var msg;
if (jqXHR.status === 0)
{
msg = 'Not connected.\n Verify Network.';
}
else if (jqXHR.status == 404)
{
msg = 'Requested page not found. [404]';
}
else if (jqXHR.status == 500)
{
msg = 'Internal Server Error [500].';
}
console.log("jqXHR.status: " +msg );
console.log("ajaxSettings: ");
console.log(ajaxSettings);
}
});