【发布时间】:2019-05-01 16:41:54
【问题描述】:
我正在尝试从 SharePoint 内容编辑器对服务器端 API 进行 POST Ajax 调用。 API 返回 URL 和标题列表。然后将 URL 动态添加到 SharePoint 列表视图中。
这在 Chrome 中可以正常工作,但在 IE 上不行。
我收到XMLHttpRequest: Network Error 0x2ef3, could not complete the operation due to error 00002ef3
我在本地使用 Ajax 调用创建了一个测试 HTML,它运行良好。 奇怪的是,如果我在同一个浏览器上打开本地 HTML 文件,它在 IE 上的 SharePoint 页面上运行良好。 有人可以帮我解决吗?
这里是 AJAX 调用:
var response;
Var settings = {
“async”: true,
“crossDomain”:true,
“url”: url1,
“method”: “POST”,
“type”:”POST”,
“dataType”:”json”,
“Keep-Alive”:”timeout=0, max=1000”,
“Cache-Control”:”no-cache, no-store, must-revalidate”,
“Pragma”:”no-cache”,
“Expires”:”0”,
“headers”:{
“Content-Type”:”application/json; charset=utf-8”,
“api_key”:key1,
“Authorization”:”Bearer “ + tkn1
},
“complete”:function(text){
response=text.responseText;
},
“cache”:false,
“processData”: false,
“data”:data1()
};
function data1(){
return JSON.stringify(data2);
}
jQuery.support.cors=true;
$.ajax(settings).complete(function(){
var resObj=JSON.parse(response);
.....
});
【问题讨论】:
标签: jquery json ajax internet-explorer sharepoint