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


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. – user3157708 Oct 5 '15 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. – user3157708 Oct 5 '15 at 7:17
  • @user3157708 please see my updated answer. – Amal Hashim Oct 7 '15 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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