I'm building a simple WebAPI 2 service based on the MVC model. I've created a simple front-end index.html page which has a button to invoke the getJSON
call, passing a relative URI. If this succeeds it should display an alert box. On the local dev machine, everything works for both IE and Chrome. However, when I try accessing from another computer on the network, it stops working in IE, but still works ok in Chrome. All of my IE are version 11. Below is the getJson code snippet. I have tried many suggestions from other posts such as using .ajax
instead with cache:false
, crossDomain:true
, and using jsonp instead.
In the IE that doesn't work, I tried manually type in the full address as that in the getJson call and it actually works. Therefore I'm guessing for some reason the .getJson
call is not executing. Any help is greatly appreciated.
$.getJSON(uri + '/' + filepath)
.done(function (data) {
alert('test');
})
.fail(function (jqXHR, textStatus, err) {
$('#product').text('Error: ' + err);
});