I am trying to use my javascript to make a call to a list that lives in a separate site collection. It is not working and blocks me due to CORS. Is there any way around this?
My question is different. The other post's user is asking for a request from the "internet", so outside of SharePoint. I am using an intranet and simply want to do a get request internally, but to call a different site collection to the one I'm on. My main javascript function looks something like this:
function getJson(endpointUri, success, error) {
$.ajax({
url: endpointUri,
type: "GET",
processData: false,
contentType: "application/json;odata=verbose",
headers: {
"Accept": "application/json;odata=verbose"
},
success: success,
error: error
});
}
function logError(error) {
console.log(JSON.stringify(error));
}