Hello,
I modified some code found on the internet to display information about a Linkedin profile. The problem is that for some Linkedin profiles the information won't show. If someone can shed some light on this problem I would be very happy.
<html><head>
<script src="ajax.googleapis.com/.../jquery.min.js"></script>
<script type="text/javascript" src="platform.linkedin.com/in.js">
// api_key: ****
// testupload
</script>
<meta charset="utf-8">
<meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta><meta></head>
<body style='background-color: white; word-wrap: break-word;'>
<script type="text/jscript">
function loadProfile() {
try
{
window.document.location.reload();
}
catch (ex) {
alert(ex.message);
}
}
try {
window.parent.Xrm.Page.ui.controls.get("WebResource_LinkedInBadge").setVisible(true);
// Retrieve the profile url form dynamics field
var linkedprofilelink = window.parent.Xrm.Page.getAttribute("pix_social_linkedin").getValue();
window.parent.Xrm.Page.getAttribute("pix_social_linkedin").addOnChange(loadProfile);
if (linkedprofilelink != null) {
// Load the profile
// linkedprofilelink = linkedprofilelink.toLowerCase();
// linkedprofilelink = linkedprofilelink.replace('http://', 'https://');
newmemberprofile(linkedprofilelink);
}
else {
window.parent.Xrm.Page.ui.controls.get("WebResource_LinkedInBadge").setVisible(false);
}
}
catch (e) {
alert(e.message);
}
function newmemberprofile(id) {
// Create the script tag
var $s = $('<script/>');
// Assign the attributes
$s.attr({
'type': 'IN/MemberProfile',
'data-id': id,
'data-related': 'false',
'data-format': 'inline',
'data-width': '350px'
});
// Inject the tag
$('body').append($s);
}
</script>
</body></html>