【发布时间】:2017-12-31 16:27:00
【问题描述】:
我正在尝试从我的 Outlook 加载项发送第三方服务的 POST Ajax 请求,但无论我尝试什么,我都会收到Error: Access is denied 和状态0(请求从未到达服务器)。
假设我们在 Outlook 后面运行 IE9 或 8,我尝试了像 https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest 这样的老派黑客。
$.ajax({
url: endpoint,
data: JSON.stringify({'1':'2'}),
// headers: {'X-Requested-With': 'XMLHttpRequest'},
contentType: 'text/plain',
type: 'POST',
dataType: 'json',
error: function(xhr, status, error) {
// error
}
}).done(function(data) {
// done
});
还有什么我需要实现的吗?当然,我将我的域添加到清单 AppDomain 属性。
干杯
【问题讨论】:
标签: ajax outlook office365 outlook-addin office-js