I have created a custom app for displaying organisation chart. But the images are not displayed because of cross domain authentication issue.

1 Answer 1


Before setting images you initiate a jQuery ajax call to the other domain. This will initiate the authentication process and subsequent references to elements in that domain will resolve automatically.

You can also set image using below script

$('#imgControlId').attr('src', _spPageContextInfo.siteAbsoluteUrl + '/_layouts/15/userphoto.aspx?accountname=' + userEmailAddress);
  • But how do I initiate a jQuery ajax call to that other domain? Can you please provide some more details. Oct 5, 2015 at 6:44
  • Actually I want display the profile pic of all the users in the organisation chart app that I have created. So if I dont login to x-my.sharepoint.com:234 site Profile pics are not displayed. Oct 5, 2015 at 7:17
  • @user3157708 please see my updated answer. Oct 7, 2015 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.