AJAX request to server respond error with status 0


#1

i am trying to access my server using below code:

$.ajax({
url:‘http://paramount.onlinetestpanel.com/temp/exa.php’,
type:‘GET’,
dataType: ‘json’,
contentType: “application/json”,
crossDomain: true,
success:function(res){
$("#res").html(JSON.stringify(res));
},
error:function(err){
$("#res").html(JSON.stringify(err));
}

    });

it respond successfully on browser testing but when i build and install to android device, it throws error with status:0.
I have also set config.xml setting to access origin to *.

What am I doing wrong? Please help me…


#2

maybe you need to add additionally the cordova whitelist plugin?


#3

thanks! you have saved my life.