I couldn't retrieve the user's information in SharePoint 2013,
$().SPServices({
operation: "GetUserProfileByName",
async: false,
AccountName: "domain//usrname",
completefunc: function (xData, Status) {
firstName = getUPValue(xData.responseXML, "Department");
//office = getUPValue(xData.responseXML, "Office");
}
});
return firstName;
}
function getUPValue(x, p) {
var thisValue = $(x).SPFilterNode("PropertyData").filter(function () {
return $(this).find("Name").text() == p;
}).find("Values").text();
return thisValue;
}
throwing error like
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
$().SPServices({
operation: "GetUserProfileByName",
async: false,
AccountName: "domain//usrname",
completefunc: function (xData, Status) {
firstName = getUPValue(xData.responseXML, "Department");
//office = getUPValue(xData.responseXML, "Office");
}
});
return firstName;
}
function getUPValue(x, p) {
var thisValue = $(x).SPFilterNode("PropertyData").filter(function () {
return $(this).find("Name").text() == p;
}).find("Values").text();
return thisValue;
}
throwing error like
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.