I am trying to have a POST Ajax call to a serverside API from SharePoint Content editor. The API returns list of URL and Title. Then the URL is added dynamically into the SharePoint List View.
This works fine in Chrome but not on IE.
I am getting XMLHttpRequest: Network Error 0x2ef3, could not complete the operation due to error 00002ef3
I created a test HTML with the Ajax call on my local and it works fine. The strange think is it works fine on the SharePoint page on IE if I had the local HTML file opened on the same browser. Can someone help me fix it?
Here is the AJAX call:
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);
.....
});