4

I'm using REST API tp get the SPusers , this is the function :

function getSiteUser(url,complete) {

    $.ajax({
        url: url + "_api/web/siteUsers?$select=LoginName",
        method: "GET",
        contentType: "application/json; charset=utf-8",

        headers: { "accept": "application/json; odata=verbose" },
        success: function (data) {
            // Returning the results
            complete(data);
        },
        error: function (data) {
            alert(data);
        }
    });
}

but I got this error :

SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.

It's not across domain application, Im in the local server , I use SharePoint foundation 2013. any ideas, best regards

Imen Turki
  • 2,183
  • 9
  • 35
  • 59
  • 1
    That script works just fine for me, provided that the URL I enter adheres to the same-origin restriction. Are you trying to request user data from a different domain or site collection? – John-M Dec 22 '14 at 13:34

0 Answers0