としてCORS要求を行う優れここで推薦して私は私のExcelのアドイン、 からのクロスドメインリクエストを作成しようとしています:http://dev.office.com/docs/add-ins/develop/addressing-same-origin-policy-limitations事務所は、クロスドメインリクエスト
私はCORS要求を実現しようとしています。 しかし、私は私の要求を開くしようとするたびに、アクセスが拒否されました。
私はhereforが接続を開くためのを試みる使用したコードしかし、ここで私はすでにエラーに
var xhr = new XMLHttpRequest();
xhr.open('GET', 'url'); //this line gives an acces denied error.
xhr.onload = function(e) {
}
xhr.send();
を取得し、ExcelでCORS要求を実装するかのうであれば、誰かが私に教えてもらえますか?私はへの呼び出しを行うときに
Ajaxでのコードは、しかし、エラーオブジェクト
$.ajax({
type: 'GET',
url: 'remoteurl',
cache: true,
},
success: function (result) {
functionAfterLoad(JSON.parse(JSON.stringify(eval("(" +result + ")"))));
},
error: function(result) {
console.error('Error while retrieving funnel HTML', result);
},
});
を与える:
$.ajax({
type: 'GET',
url: window.location.href ,
cache: true,
},
success: function (result) {
functionAfterLoad(JSON.parse(JSON.stringify(eval("(" +result + ")"))));
},
error: function(result) {
console.error('Error while retrieving funnel HTML', result);
},
});
は、私がwitouth結果としてHTMLページを得るか、エラーの
ちょっと@leetibbett xhr.withCredentials = trueを追加しても、アクセス拒否でランタイムエラーが発生します。フラグ。 –
IEの設定でCORSが許可されていますか? [this post](https://social.microsoft.com/Forums/en-US/04d357e2-847d-45af-bc34-f4f265fe1bbb/i-am-getting-access-denied-error-when-using)の回答を参照してください。 -xmlhttprequest-in-javascript-to-fetch-data?forum = crmdevelopment)どこに行くのですか? – leetibbett
はい、私の設定でCORSが許可されていますが、 –