获取保存在 SharePoint 列表中的图像的 url

Get the url of an image saved in SharePoint List

我使用 SharePoint 列表已有一段时间了。但现在我面临一个问题。我在 SharePoint 列表中输入了三列,并使用 SharePoint 列表中的信息将其显示在网站上。我想使用从 SharePoint 列表输入的 URL 来显示图像。 SharePoint List Image

我正在使用此 js 代码使图像显示在屏幕上。

/**The function for displaying the data received from the list**/
function displayList1Details(data){
$.each(data.d.results, function(key, value){
console.log(value);
$("#thoughts").append(value.Thoughts),
$("#thoughtsName").append(value.EmployeeName),
$("#thoughtsImage").attr("src", "value.PictureLink") });
}

我无法显示它,我试过使用 "value.PictureLink" 并且没有引号。还是行不通。谁能告诉我解决方案?还是不可能?

登录时的控制台显示如下 Console log part1 console log part2

  1. value.PictureLink 中删除引号。

有时在 SharePoint 中,SharePoint 会对您的输入做额外的工作 "sanitize" 以避免脚本执行。

从[=26=的输出可以看出,value.PictureLink的值=<div class="..."><p>http&#58;//updaters.sharepoint.com/sites/spdev/SiteAssets/pics/myImage.jpg<br></p></div>

我假设列的类型是 multiple lines of text。将其更改为 single line of text 然后尝试您的代码。如果这不起作用,请 post 更新的控制台日志图片。