0

I have an image url defined in my javascript code as:

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;

I have to pass this as src attribute to an image:

content += "<img src=\"'+res+'\" width = \"65px\" height = \"35px\"/>";

Linking the url works this way:

var str = "View Image";
var result = str.link(res);
content += result+"<br><br>";

But I cannot see the image in HTML doc. Can anyone guide as to why it could be happening and what is the alternative?

jcoder12
  • 167
  • 1
  • 4
  • 15
  • Are you sure that your current user has permissions to access that document? And are you sure you're building the right URL? – Gagravarr May 21 '14 at 10:25
  • Hi @Gagravarr, yes I am absolutely sure about the URL and the permission. I am logging as admin and viewing. There is some problem in passing string to JavaScript, I guess. Also, in Alfresco none of the normal functions of JS work like, innerHTML() or createElement() or getElementByTag(). – jcoder12 May 21 '14 at 12:26

0 Answers0