Microsoft Dynamics Nav 2013 用の JavaScript を使用してアドインを作成しました。Navision と同じマシンでアドインを使用すると問題なく動作します。それにもかかわらず、マシンの名前を「localhost」に置き換えると、機能しません。これは私のスクリプトです:
$(document).ready(function() {
//This does not work
var url = "http://myService:7057/OData/Company('Company')/CRMSPABookings?$format=json";
// This works
// var url = "http://localhost:7057/OData/Company('Company')/CRMSPABookings?$format=json";
$.ajaxSetup({
xhrFields: {
withCredentials: true
}
});
var http_request = new XMLHttpRequest();
http_request.open("GET", url, false);
http_request.withCredentials = "true";
http_request.send();
xmlDocImage = http_request.responseText;
var x = JSON.parse(xmlDocImage);
});
なにか提案を?
どうもありがとうございました。