Here is my web service that works perfectly fine in Fiddler and in my browser: http://localhost:11458/PlayerSvc.svc/GetPLayers
I then tried to call this via Jquery in phonegap and it failed: here is my jquery in phonegap using Eclipse:
<script type="text/javascript">
$.ajax({
url: 'http://localhost:11458/PlayerSvc.svc/GetPlayers',
dataType: 'json',
// timeout: 55000,
// beforeSend: function(xhr) {
//Possible to set any required headers here
//xhr.setRequestHeader('Authorization', 'username password');
// },
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert('failed');
},
success: function(data) {
alert('success');
}
});
</script>
To make sure there was nothing wrong with my jquery I tested another webservice with this code and it was successful. I am not sure how to gather more information on how to debug this. I tried wrapping my javascript with console.log(javascript above) and I could not get that to work. As you can see above I just used the alert function to output the failed error message. Any ideas? I think i may try using a try catch and then seeing if I can output the exception...