yan*_*nik 4 ajax outlook outlook-addin office365 office-js
我正在尝试从我的Outlook加载项发送第三方服务的POST Ajax请求,但无论我尝试接收什么Error: Access is denied,状态0(请求永远不会命中服务器).
假设我们正在运行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
});
Run Code Online (Sandbox Code Playgroud)
我需要实施更多的东西吗?因为我将我的域添加到manifest AppDomain属性.
干杯
要向第三方服务发送请求,需要执行以下操作...
AppDomain列表中(您已完成它.)在观察您的代码时,我注意到您正在发送JSON对象,但将内容类型设置为"text/plain".联系服务创建者以获取有关他们接受的数据类型的信息.通常服务允许"application/json",但不允许纯文本.
| 归档时间: |
|
| 查看次数: |
2541 次 |
| 最近记录: |