When I Get the document list from sharepointSharePoint site I get this error" 401error "401 (Unauthorized)" only in Google Chrome, but in IE it workworks. This is my code
function GetListItems() {
var siteURL = "http://localhost:8032/_api/web/GetFolderByServerRelativeUrl('Data%20Do')/File";
return $.ajax({
url: siteURL,
async: false,
method: "GET",
headers: {
"Accept": "application/json;odata=verbose",
}
});
}
I get this two error in Google Chrome:
1.OPTIONS "http:......" 401 (Unauthorized)
OPTIONS "http:......" 401 (Unauthorized)
2.jquery-1.7.2.min.js:4 XMLHttpRequest cannot load http://localhost:8032/_api/web/GetFolderByServerRelativeUrl('Data%20Do')/Files. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8032' is therefore not allowed access. The response had HTTP status code 401.and
jquery-1.7.2.min.js:4 XMLHttpRequest cannot load http://localhost:8032/_api/web/GetFolderByServerRelativeUrl('Data%20Do')/Files. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8032' is therefore not allowed access. The response had HTTP status code 401.