0

I am making an jquery ajax call as shown in below code snippet. Getting "No transport error" on IE8 and "Cross-origin request blocked" o Firefox browsers.

However it works fine on external REST clients, when I call the service. Such as chrome advance rest client, postman etc.

Please let me know if anything wrong in the below code.

$(document).ready(function () {
    $("#myButton").click(function () {
        var url = 'https://testserver/accounts/123456/accountdetails/loaninfo';

        $.ajax({
            url: url,
            contentType: 'application/json',
            type: 'GET',
            dataType: 'json',
            crossDomain: true,
            headers: {
                'Api-Key': 'MyAppKey',
                'Accept': 'application/json'
            },
            success: function (data, status, xhr) {
                alert(status);
            },
            error: function (data, status, xhr) {
                alert(status);
              }
        });

    });
});
rajcool111
  • 657
  • 4
  • 14
  • 36

0 Answers0