Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Alfresco中使用JavaScript无法在HTML文档中显示图像_Alfresco_Alfresco Share - Fatal编程技术网

在Alfresco中使用JavaScript无法在HTML文档中显示图像

在Alfresco中使用JavaScript无法在HTML文档中显示图像,alfresco,alfresco-share,Alfresco,Alfresco Share,我在javascript代码中定义了一个图像url: var boxwidth = document.properties["sc:price"]; content += "<body align=\"center\"><font face= \"Comic sans MS\">"; content += "<b>Retail Price: </b>" + price + "<br><br>"; var urlStr = d

我在javascript代码中定义了一个图像url:

var boxwidth = document.properties["sc:price"];
content += "<body align=\"center\"><font face= \"Comic sans MS\">";
content += "<b>Retail Price: </b>" + price + "<br><br>";
var urlStr = document.assocs["sc:relatedDocuments"][0].url;
//image document url
var res = "http://hostname:port/share/proxy/alfresco/api/node/content/"+urlStr.substring(4);
document.content = content;
var-boxwidth=document.properties[“sc:price”];
内容+=”;
内容+=“零售价:“+Price+”

”; var urlStr=document.assocs[“sc:relatedDocuments”][0]。url; //图像文档url var res=”http://hostname:port/share/proxy/alfresco/api/node/content/“+urlStr.子字符串(4); document.content=内容;
我必须将此作为src属性传递给图像:

content += "<img src=\"'+res+'\" width = \"65px\" height = \"35px\"/>";
content+=”;
链接url的方式如下:

var str = "View Image";
var result = str.link(res);
content += result+"<br><br>";
var str=“查看图像”;
var结果=str.link(res);
内容+=结果+“

”;

但是我在HTML文档中看不到图像。有人能告诉你为什么会发生这种情况,还有什么办法吗?

你确定你的当前用户有权访问该文档吗?你确定你建立了正确的URL吗?嗨@Gagravarr,是的,我绝对确定URL和权限。我以管理员身份登录并查看。我想,在将字符串传递给JavaScript时会出现一些问题。此外,在Alfresco中,JS的正常函数都不像innerHTML()或createElement()或getElementByTag()那样工作。