I am trying to make ajax call to an alteryx server from a local HTML page. The request I make is working fine and I am getting response on Internet Explorer but does not load on GoogleChrome/Firefox. Getting 'Access-Control-Allow-Origin' error as:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 401.
I have tried adding the 'Access-Control-Allow-Origin' to the ajax request header as follows, but this also does not resolves my issue:
$.ajax({
type: 'GET',
url: 'xxxxxxx',
header: {'Access-Control-Allow-Origin': '*'},
data: params,
success: success,
error: error
});
I have traced the request/response header in browser console and could see the custom header under Access-Control-Headers tag. The data I am receiving is in json format. Also, I cannot make any changes from the server response end as I have no access to it.
I cannot understand why IE is able to load the page and other browsers cannot and if is there any other possible workaround to make it work on other browsers as well.
Thanks, Aakash