0

When i tired to get list title from developer site present in SharePoint online, i get CROS error. I have provided full permission to list and web in AppManifest.xml;

It is a simple ajax call that consume Sharepoint api rest services

Code:-

function ajaxcall() {
    var url1 = "https://xxxlll365.sharepoint.com/sites/devsite/_api/web/lists/getbytitle('xxx')/items?$select=Title";

    $.ajax({

        url: url1,
        dataType: 'json', //tired xml,jsonp, crossdoman:true [no big change]
        cros: true,
        success: function (result) {
            $("#div1").html(result);
        }
    });

Console Error XMLHttpRequest for https://xxxlll365.sharepoint.com/sites/devsite/_api/web/lists/getbytitle('xxx')/items?$select=Title required Cross Origin Resource Sharing (CORS)."Error"

Tired with angularJS and got same error as above !

Vinod kumar G
  • 639
  • 6
  • 17

2 Answers2

0

Here are some detailed articles for your reference:

WebAPI and CORS enabled REST services

Cross Site Scripting with SharePoint 2013 REST calls

CORS with sharepoint

CORS SP

Siddharth Jain
  • 336
  • 2
  • 9
0

Try include in the header these options:

"Control-Allow-Origin","https://xxxlll365.sharepoint.com")

"Origin","https://xxxlll365.sharepoint.com")