This is my first time working with an Ajax request from client-side code, so I hope there's some obvious error that I'm just not seeing in my code. Let me preface this by saying when I manually navigate to the URL listed below, I get a JSON response. So, the URL is good. But, when I make the Ajax GET request, I end up with the error:
Here's my client side code:
$.ajax({
url: 'http://localhost/TestApp.WebAPI/api/BulletinBoard/APPNAME',
type: 'GET',
dataType: 'json',
crossDomain: true,
success: function (data) {
WriteResponse(data);
},
error: function (x, y, z) {
alert(x + '\n' + y + '\n' + z);
}
});
So, the code is hitting the error but I'm not sure why. I'm not an expert with JavaScript so I'm not sure if there's anything I can do to get a more detailed version of the error, but I hope that there's something obvious that I'm missing.