Tag Archives: user

How to get logged in user image in SharePoint 2013 (MySite)

$.ajax({ url: _spPageContextInfo.webAbsoluteUrl + “/_api/SP.UserProfiles.PeopleManager”+ “/GetMyProperties?$select=PictureUrl,DisplayName,AccountName”, type: “GET”, contentType: “application/json;odata=verbose”, headers: { “accept”: “application/json;odata=verbose” }, async: false, success: function (data) { var pic = data.d.PictureUrl; var member = data.d.DisplayName; if (pic) { $(“#userName”).text(member); $(“#paduserName”).text(member); $(“.imageicon”).attr(“src”,pic.Url); } else { $(“#userName”).text(member); $(“#paduserName”).text(member); … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment