Have a column in a SharePoint 2010 list set to Person or Group. Name (with Picture)
I've created JavaScript code that gets the Name, ID etc. However I also want to get the image. I've tried the code below but it outputs the name of the person, I've also tried .get_url but then an error:
The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
I am loading Photo column explicitly:
clientContext.load(collListItemBlog,'Include(Photo)');
//
//later
alert (oListItem.get_item('Photo').get_lookupValue()); // prints name
alert (oListItem.get_item('Photo').get_url()); // errors
How can I get the picture url and add it to my javascript page?
Thanks